Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

some refactoring to dss/copy-defun-name

  • Loading branch information...
commit d0dc65457f3b7ce88b00360413b1ce111e0bb600 1 parent 4f3c753
@tavisrudd authored
Showing with 12 additions and 3 deletions.
  1. +12 −3 dss-codenav-helpers.el
View
15 dss-codenav-helpers.el
@@ -161,13 +161,22 @@ Do nothing if not in string."
(forward-char)
(dss/indent-sexp)))
-(defun dss/copy-defun-name ()
+(defun dss/defun-name ()
(interactive)
(save-excursion
(dss/out-sexp)
(forward-to-word 2)
- (k2-copy-whole-sexp)
- (message (car kill-ring))))
+ (mark-sexp 1)
+ (let ((defun-name (buffer-substring (region-beginning) (region-end))))
+ (if defun-name
+ (set-text-properties 0 (length defun-name) nil defun-name))
+ defun-name)))
+
+(defun dss/copy-defun-name ()
+ (interactive)
+ (let ((defun-name (dss/defun-name)))
+ (kill-new defun-name)
+ (message defun-name)))
(defun dss/eval-defun ()
"The built-in eval-defun doesn't choose the top level forms I would expect expect"
Please sign in to comment.
Something went wrong with that request. Please try again.