mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
Fix C-x C-e with defvars in comments preceding
* lisp/progmodes/elisp-mode.el (eval-sexp-add-defvars): When collecting defvars in the current buffer, ignore the ones that are in comments or strings (bug#34233).
This commit is contained in:
parent
60fc771ac6
commit
a87bdb8f91
1 changed files with 5 additions and 1 deletions
|
|
@ -1179,7 +1179,11 @@ POS specifies the starting position where EXP was found and defaults to point."
|
|||
(let ((var (intern (match-string 1))))
|
||||
(and (not (special-variable-p var))
|
||||
(save-excursion
|
||||
(zerop (car (syntax-ppss (match-beginning 0)))))
|
||||
(let ((syntax (syntax-ppss (match-beginning 0))))
|
||||
;; Top-level.
|
||||
(and (zerop (car syntax))
|
||||
;; Not in a comment or string.
|
||||
(null (nth 8 syntax)))))
|
||||
(push var vars))))
|
||||
`(progn ,@(mapcar (lambda (v) `(defvar ,v)) vars) ,exp)))))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue