bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#66902: 30.0.50; Recognize env -S/--split-string in shebangs


From: Kévin Le Gouguec
Subject: bug#66902: 30.0.50; Recognize env -S/--split-string in shebangs
Date: Sun, 12 Nov 2023 18:53:40 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Kévin Le Gouguec <kevin.legouguec@gmail.com> writes:

> Questions before proceeding to ChangeLog entries & regression tests:

For better or worse, I ended up proceeding to both these things, and
then some.  Let me know if the attached patches make sense; tested with

  make -j8 bootstrap && make -C test files-tests


Tentative answers to my questions:

> 1. Is this something we would like Emacs to recognize out of the box, or
> is it too niche?

Assuming yes.

> 2. What about the more general forms shown in (info "(coreutils) env
> invocation")?
>
>   #!/usr/bin/env -[v]S[OPTION]... [NAME=VALUE]... COMMAND [ARGS]...

Didn't go as far as handling -v nor NAME=VALUE pairs, but that could be
added later if we ever feel like it.

> 3. Assuming we do want to amend that regexp, would it be possible to use
> rx here?  OT1H guessing "no" because files.el is pre-reloaded, whereas
> rx.el is not; OTOH I see that files.el requires easy-mmode at
> compile-time, and that package does not show up in loadup.el, so…
> settling for "maybe?"

Figured rx was similar to pcase in that regard:

* They need to be required explicitly despite their macros being
  "autoloaded", because files.el is loaded during bootstrap before
  autoloading is set up.

* Somehow that does not cause them to be preloaded?  At least going by
  emacs -Q,
  * featurep returns nil,
  * preloaded-file-list does not include them.

Attachment: 0001-Add-basic-tests-for-interpreter-mode-alist.patch
Description: Text Data

Attachment: 0002-Convert-auto-mode-interpreter-regexp-to-an-rx-form.patch
Description: Text Data

Attachment: 0003-Recognize-shebang-lines-that-pass-S-split-string-to-.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]