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

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

bug#64939: 30.0.50; The default auto-mode-interpreter-regexp does not ma


From: Kévin Le Gouguec
Subject: bug#64939: 30.0.50; The default auto-mode-interpreter-regexp does not match env with flags
Date: Sat, 10 Feb 2024 18:08:18 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

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

> Is this Good Enough™ for your purposes (Malcolm, Wilhelm), or should we
> sophisticate the regexp further?  FWIW, in no particular order:
>
> (a) env(1) does seem to support mixing up arbitrary options with -S¹, so
>     in principle it would make sense to support that;
>
> (b) Eli did not seem too found of the regexp hammer², so I don't know
>     which direction we'd want to go between maximally correct (accept
>     all arguments, _as long as_ -S|--split-string is in there) or good
>     enough (just skip over --everything --that --looks --like -a
>     --switch).
>
> (c) FWIW the "maximally correct" regexp might not be _that_ ugly, since
>     "-[v]S[OPTION]" must be the *first* token after env; in other words
>     no need to support --some-option --split-string --more-options.

Well, sorry, couldn't resist.  How do the attached patches look?  The
new testcases should tell the whole story.

('make && make -C test files-tests' seems none the worse for wear)

Attachment: 0001-Refine-shebang-tests-bug-64939.patch
Description: Text Data

Attachment: 0002-Support-more-complex-env-invocations-in-shebang-line.patch
Description: Text Data

Attachment: 0003-Support-shebang-lines-with-amended-environment.patch
Description: Text Data


reply via email to

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