Skip to content

Instantly share code, notes, and snippets.

@hiredman
Created February 22, 2012 03:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hiredman/1880975 to your computer and use it in GitHub Desktop.
Save hiredman/1880975 to your computer and use it in GitHub Desktop.
edit-function
(defun edit-function ()
""
(interactive)
(lexical-let ((the-buffer-name (buffer-name))
(clojure-ns (clojure-find-ns))
(keymap (current-local-map))
(parent-buffer (current-buffer)))
(progn
(clone-indirect-buffer-other-window nil t)
(use-local-map (copy-keymap keymap))
(narrow-to-defun)
(when clojure-ns
(rename-buffer (format "*fn %s/%s*"
clojure-ns
(car (cdr (split-string (buffer-string)))))))
(local-set-key (kbd "C-c f")
(lambda (&rest args)
(interactive)
(kill-buffer (current-buffer)))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment