summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/lisp-mode.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2014-05-10 23:48:15 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2014-05-10 23:48:15 -0400
commit4eb436826bd7912925634624beaf4173546dad49 (patch)
tree54937e814b6e9235f823bfee41c187a901b9a988 /lisp/emacs-lisp/lisp-mode.el
parent0994e45d163f121a64084a3b8bf7bb67dc4cef18 (diff)
downloademacs-4eb436826bd7912925634624beaf4173546dad49.tar.gz
emacs-4eb436826bd7912925634624beaf4173546dad49.tar.bz2
emacs-4eb436826bd7912925634624beaf4173546dad49.zip
* lisp/emacs-lisp/lisp-mode.el (preceding-sexp): Exclude leading "," which
are a hindrance for C-x C-e.
Diffstat (limited to 'lisp/emacs-lisp/lisp-mode.el')
-rw-r--r--lisp/emacs-lisp/lisp-mode.el26
1 files changed, 10 insertions, 16 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 690aa3d7460..21529894fed 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -1017,26 +1017,20 @@ If CHAR is not a character, return nil."
(forward-sexp -1))))
(save-restriction
- ;; vladimir@cs.ualberta.ca 30-Jul-1997: skip ` in
- ;; `variable' so that the value is returned, not the
- ;; name
- (if (and ignore-quotes
- (eq (following-char) ?`))
+ (if (and ignore-quotes (eq (following-char) ?`))
+ ;; vladimir@cs.ualberta.ca 30-Jul-1997: Skip ` in `variable' so
+ ;; that the value is returned, not the name.
(forward-char))
+ (when (looking-at ",@?") (goto-char (match-end 0)))
(narrow-to-region (point-min) opoint)
(setq expr (read (current-buffer)))
- ;; If it's an (interactive ...) form, it's more
- ;; useful to show how an interactive call would
- ;; use it.
- (and (consp expr)
- (eq (car expr) 'interactive)
+ ;; If it's an (interactive ...) form, it's more useful to show how an
+ ;; interactive call would use it.
+ ;; FIXME: Is it really the right place for this?
+ (when (eq (car-safe expr) 'interactive)
(setq expr
- (list 'call-interactively
- (list 'quote
- (list 'lambda
- '(&rest args)
- expr
- 'args)))))
+ `(call-interactively
+ (lambda (&rest args) ,expr args))))
expr)))))