all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 64272@debbugs.gnu.org, andpuke@foxmail.com
Subject: bug#64272: 28.1; lisp_file_lexically_bound_p behavior mismatches file local variables
Date: Sun, 25 Jun 2023 11:42:42 -0400	[thread overview]
Message-ID: <jwv7crro8gz.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <83mt0ny47z.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 25 Jun 2023 18:02:56 +0300")

>> 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






  reply	other threads:[~2023-06-25 15:42 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-24 18:22 bug#64272: 28.1; lisp_file_lexically_bound_p behavior mismatches file local variables LdBeth
2023-06-24 18:52 ` Eli Zaretskii
2023-06-24 19:08   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-25  2:11   ` LdBeth
2023-06-25  6:08     ` Eli Zaretskii
2023-06-25 13:37       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-25 15:02         ` Eli Zaretskii
2023-06-25 15:42           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-06-25 17:17           ` LdBeth
2023-06-25 18:16             ` Eli Zaretskii
2023-06-25 23:00               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-26  0:53                 ` LdBeth
2023-06-26 11:13                   ` Eli Zaretskii
2023-06-26 15:18                     ` Gregory Heytings
2023-06-26 15:23                       ` Eli Zaretskii
2023-11-21 13:12                       ` Gerd Möllmann
2023-06-26 10:59                 ` Eli Zaretskii
2023-06-25 23:16               ` LdBeth
2023-06-26  0:45                 ` LdBeth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv7crro8gz.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=64272@debbugs.gnu.org \
    --cc=andpuke@foxmail.com \
    --cc=eliz@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.