summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/lisp-mode.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-07-31 06:59:37 +0000
committerRichard M. Stallman <rms@gnu.org>1997-07-31 06:59:37 +0000
commit05e94d325c942a7d977e327193a32ecf5b109665 (patch)
tree3f6110e7959ccb84af69b4d454ec3bcb0a5fe7e6 /lisp/emacs-lisp/lisp-mode.el
parentf31b5dd98527d82a78d8d79dd1455176aaf37b00 (diff)
downloademacs-05e94d325c942a7d977e327193a32ecf5b109665.tar.gz
emacs-05e94d325c942a7d977e327193a32ecf5b109665.tar.bz2
emacs-05e94d325c942a7d977e327193a32ecf5b109665.zip
(eval-last-sexp): Ignore `...' around sexp.
Diffstat (limited to 'lisp/emacs-lisp/lisp-mode.el')
-rw-r--r--lisp/emacs-lisp/lisp-mode.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index be328b30329..f84b3374a1c 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -296,12 +296,24 @@ With argument, print output into current buffer."
(let ((standard-output (if eval-last-sexp-arg-internal (current-buffer) t)))
(prin1 (eval (let ((stab (syntax-table))
(opoint (point))
+ ignore-quotes
expr)
(unwind-protect
(save-excursion
(set-syntax-table emacs-lisp-mode-syntax-table)
+ ;; If this sexp appears to be enclosed in `...'
+ ;; then ignore the surrounding quotes.
+ (setq ignore-quotes
+ (or (eq (following-char) ?\')
+ (eq (preceding-char) ?\')))
(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) ?`))
+ (forward-char))
(narrow-to-region (point-min) opoint)
(setq expr (read (current-buffer)))
;; If it's an (interactive ...) form, it's more