GNU bug report logs - #64272
28.1; lisp_file_lexically_bound_p behavior mismatches file local variables

Previous Next

Package: emacs;

Reported by: LdBeth <andpuke <at> foxmail.com>

Date: Sat, 24 Jun 2023 18:24:02 UTC

Severity: normal

Tags: confirmed

Merged with 67321

Found in versions 28.1, 29.1.90

Full log


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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 64272 <at> debbugs.gnu.org, andpuke <at> foxmail.com
Subject: Re: bug#64272: 28.1; lisp_file_lexically_bound_p behavior
 mismatches file local variables
Date: Sun, 25 Jun 2023 11:42:42 -0400
>> I'd much rather we try and stay as close as possible to the behavior of
>> `hack-local-variables-prop-line`
>
> Right, but that doesn't require the -*- line to be a comment:
>
>       (goto-char (point-min))
>       (let ((end (set-auto-mode-1))
> 	    result)
> 	(cond ((not end)
> 	       nil)
> 	      ((looking-at "[ \t]*\\([^ \t\n\r:;]+\\)\\([ \t]*-\\*-\\)")
> 	       ;; Simple form: "-*- MODENAME -*-".
> 	       (if (eq handle-mode t)
> 		   (intern (concat (match-string 1) "-mode"))))
> 	      (t
> 	       ;; Hairy form: '-*-' [ <variable> ':' <value> ';' ]* '-*-'
> 	       ;; (last ";" is optional).
> 	       ;; If HANDLE-MODE is t, just check for `mode'.
> 	       ;; Otherwise, parse the -*- line into the RESULT alist.
>
> The fact that most -*- lines are in comments is because they are in
> program source files, so we need to hide them from the compiler or the
> interpreter.

Oh, indeed.  Then `ldb`s suggestion sounds great since it makes us "stay
as close as possible to the behavior of
`hack-local-variables-prop-line`".


        Stefan





This bug report was last modified 1 year and 156 days ago.

Previous Next


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