Mercurial > emacs
comparison lisp/emacs-lisp/lisp-mode.el @ 19057:b1251bcaaa0e
(eval-last-sexp): Ignore `...' around sexp.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 31 Jul 1997 06:59:37 +0000 |
parents | 71db8e3ee12f |
children | 6cb3ebfb6bc8 |
comparison
equal
deleted
inserted
replaced
19056:3c63e633c40c | 19057:b1251bcaaa0e |
---|---|
294 With argument, print output into current buffer." | 294 With argument, print output into current buffer." |
295 (interactive "P") | 295 (interactive "P") |
296 (let ((standard-output (if eval-last-sexp-arg-internal (current-buffer) t))) | 296 (let ((standard-output (if eval-last-sexp-arg-internal (current-buffer) t))) |
297 (prin1 (eval (let ((stab (syntax-table)) | 297 (prin1 (eval (let ((stab (syntax-table)) |
298 (opoint (point)) | 298 (opoint (point)) |
299 ignore-quotes | |
299 expr) | 300 expr) |
300 (unwind-protect | 301 (unwind-protect |
301 (save-excursion | 302 (save-excursion |
302 (set-syntax-table emacs-lisp-mode-syntax-table) | 303 (set-syntax-table emacs-lisp-mode-syntax-table) |
304 ;; If this sexp appears to be enclosed in `...' | |
305 ;; then ignore the surrounding quotes. | |
306 (setq ignore-quotes | |
307 (or (eq (following-char) ?\') | |
308 (eq (preceding-char) ?\'))) | |
303 (forward-sexp -1) | 309 (forward-sexp -1) |
304 (save-restriction | 310 (save-restriction |
311 ;; vladimir@cs.ualberta.ca 30-Jul-1997: skip ` in | |
312 ;; `variable' so that the value is returned, not the | |
313 ;; name | |
314 (if (and ignore-quotes | |
315 (eq (following-char) ?`)) | |
316 (forward-char)) | |
305 (narrow-to-region (point-min) opoint) | 317 (narrow-to-region (point-min) opoint) |
306 (setq expr (read (current-buffer))) | 318 (setq expr (read (current-buffer))) |
307 ;; If it's an (interactive ...) form, it's more | 319 ;; If it's an (interactive ...) form, it's more |
308 ;; useful to show how an interactive call would | 320 ;; useful to show how an interactive call would |
309 ;; use it. | 321 ;; use it. |