]> git.eshelyaron.com Git - emacs.git/commit
Support more complex env invocations in shebang lines
authorKévin Le Gouguec <kevin.legouguec@gmail.com>
Sat, 10 Feb 2024 16:37:35 +0000 (17:37 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sat, 17 Feb 2024 13:03:05 +0000 (14:03 +0100)
commite4beecd91648b1742beac769a7d2c99f070e8f6d
treedb628b19c301c9e2f7aceea452cbd25fbe416073
parent999d5fe3dfa5602afc360622874bf76bd7de9ae2
Support more complex env invocations in shebang lines

This is not an exact re-implementation of what env accepts, but
hopefully it should be "good enough".

Example of known limitation: we assume that arguments for
--long-options will be set with '=', but that is not
necessarily the case.  '--unset' (mandatory argument) can be
passed as '--unset=VAR' or '--unset VAR', but
'--default-signal' (optional argument) requires an '=' sign.

For bug#64939.

* lisp/files.el (auto-mode-interpreter-regexp): Account for
supplementary arguments passed beside -S/--split-string.
* test/lisp/files-tests.el (files-tests-auto-mode-interpreter):
Test some of these combinations.

(cherry picked from commit ecb9641ecb5f42899042ff9c164ec7dbb8e166fe)
lisp/files.el
test/lisp/files-tests.el