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
713c3fb1
Commit
713c3fb1
authored
Jul 29, 1999
by
Dave Love
Browse files
(eval-defun): Re-written to avoid
capturing variables.
parent
5f6a0375
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
31 deletions
+34
-31
lisp/emacs-lisp/lisp-mode.el
lisp/emacs-lisp/lisp-mode.el
+34
-31
No files found.
lisp/emacs-lisp/lisp-mode.el
View file @
713c3fb1
;;; lisp-mode.el --- Lisp mode, and its idiosyncratic commands.
;; Copyright (C) 1985, 1986 Free Software Foundation, Inc.
;; Copyright (C) 1985, 1986
, 1999
Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: lisp, languages
...
...
@@ -356,6 +356,13 @@ if it already has a value.\)
With argument, insert value in current buffer after the defun.
Return the result of evaluation."
(
interactive
"P"
)
(
save-excursion
;; Arrange for eval-region to "read" the (possibly) altered form.
;; eval-region handles recording which file defines a function or
;; variable. Re-written using `apply' to avoid capturing
;; variables like `end'.
(
apply
#'
eval-region
(
let
((
standard-output
(
if
eval-defun-arg-internal
(
current-buffer
)
t
))
beg
end
form
)
;; Read the form from the buffer, and record where it ends.
...
...
@@ -374,18 +381,14 @@ Return the result of evaluation."
(
default-boundp
(
nth
1
form
)))
;; Force variable to be bound.
(
set-default
(
nth
1
form
)
(
eval
(
nth
2
form
)))))
;; Now arrange for eval-region to "read" the (possibly) altered form.
;; eval-region handles recording which file defines a function or variable.
(
save-excursion
(
eval-region
beg
end
standard-output
#'
(
lambda
(
ignore
)
(
list
beg
end
standard-output
`
(
lambda
(
ignore
)
;; Skipping to the end of the specified region
;; will make eval-region return.
(
goto-char
end
)
form
))
;; The result of evaluation has been put onto VALUES.
;; So return it.
(
car
values
))))
(
goto-char
,
end
)
,
form
)))))
;; The result of evaluation has been put onto VALUES. So return it.
(
car
values
))
(
defun
lisp-comment-indent
()
(
if
(
looking-at
"\\s<\\s<\\s<"
)
...
...
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