GNU bug report logs - #34233
27.0.50; defvar in comment

Previous Next

Package: emacs;

Reported by: Sebastian Miele <sebastian.miele <at> gmail.com>

Date: Mon, 28 Jan 2019 12:04:01 UTC

Severity: normal

Tags: fixed

Found in version 27.0.50

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 34233 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 34233 <at> debbugs.gnu.org, Sebastian Miele <sebastian.miele <at> gmail.com>,
 Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Subject: Re: bug#34233: 27.0.50; defvar in comment
Date: Wed, 10 Jul 2019 23:17:02 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> So is this the correct solution?
>
> diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
> index cb1b17b447..0e99cb9ac0 100644
> --- a/lisp/progmodes/elisp-mode.el
> +++ b/lisp/progmodes/elisp-mode.el
> @@ -1179,7 +1179,13 @@ eval-sexp-add-defvars
>            (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.
> +                          (null (nth 4 syntax))
> +                          ;; Not in a string.
> +                          (null (nth 3 syntax)))))
>                   (push var vars))))
>          `(progn ,@(mapcar (lambda (v) `(defvar ,v)) vars) ,exp)))))

Yes, I think so, plus Noam's suggestion.

Michael.




This bug report was last modified 5 years and 308 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.