Created
February 22, 2012 03:03
-
-
Save hiredman/1880975 to your computer and use it in GitHub Desktop.
edit-function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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