Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
361721f2
Commit
361721f2
authored
Feb 23, 1997
by
Karl Heuer
Browse files
(eval-last-sexp): Allow let-bindings to terminate
before doing the eval. Handle (interactive ...) form specially.
parent
a21b845b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
+19
-5
lisp/emacs-lisp/lisp-mode.el
lisp/emacs-lisp/lisp-mode.el
+19
-5
No files found.
lisp/emacs-lisp/lisp-mode.el
View file @
361721f2
...
...
@@ -293,16 +293,30 @@ if that value is non-nil."
"Evaluate sexp before point; print value in minibuffer.
With argument, print output into current buffer."
(
interactive
"P"
)
(
let
((
standard-output
(
if
eval-last-sexp-arg-internal
(
current-buffer
)
t
))
(
opoint
(
point
)))
(
prin1
(
let
((
stab
(
syntax-table
)))
(
eval
(
unwind-protect
(
let
((
standard-output
(
if
eval-last-sexp-arg-internal
(
current-buffer
)
t
)))
(
prin1
(
eval
(
let
((
stab
(
syntax-table
))
(
opoint
(
point
))
expr
)
(
unwind-protect
(
save-excursion
(
set-syntax-table
emacs-lisp-mode-syntax-table
)
(
forward-sexp
-1
)
(
save-restriction
(
narrow-to-region
(
point-min
)
opoint
)
(
read
(
current-buffer
))))
(
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
)
(
setq
expr
(
list
'call-interactively
(
list
'quote
(
list
'lambda
'
(
&rest
args
)
expr
'args
)))))
expr
))
(
set-syntax-table
stab
)))))))
(
defun
eval-defun
(
eval-defun-arg-internal
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment