diff options
| author | Kévin Le Gouguec | 2023-11-12 10:55:24 +0100 |
|---|---|---|
| committer | Eli Zaretskii | 2023-11-19 11:05:26 +0200 |
| commit | 53bd2d57f34af1efd88c6d189ab15e6f44866333 (patch) | |
| tree | c650031f9d5c3607003fe75c3e746e94d50ffdab /java/org/gnu | |
| parent | 779e669bbccb87c9462ae06ad48c0b868ec6c22b (diff) | |
| download | emacs-53bd2d57f34af1efd88c6d189ab15e6f44866333.tar.gz emacs-53bd2d57f34af1efd88c6d189ab15e6f44866333.zip | |
Recognize shebang lines that pass '-S/--split-string' to 'env'
* etc/NEWS: announce the change.
* lisp/files.el (auto-mode-interpreter-regexp): Add optional '-S'
switch to the ignored group capturing the env invocation.
Allow multiple spaces between #!, interpreter and first argument:
empirically, Linux's 'execve' accepts that. (Bug#66902)
* test/lisp/files-tests.el (files-tests--check-shebang): New helper to
generate a temporary file with a given interpreter line, and assert
that the mode picked by 'set-auto-mode' is derived from an expected
mode. Write the 'should' form so that failure reports include useful
context; for example:
(ert-test-failed
((should
(equal (list shebang actual-mode) (list shebang expected-mode)))
:form
(equal ("#!/usr/bin/env -S make -f" fundamental-mode)
("#!/usr/bin/env -S make -f" makefile-mode))
:value nil :explanation
(list-elt 1 (different-atoms fundamental-mode makefile-mode))))
* test/lisp/files-tests.el (files-tests-auto-mode-interpreter): New
test; exercise some aspects of 'interpreter-mode-alist'.
Diffstat (limited to 'java/org/gnu')
0 files changed, 0 insertions, 0 deletions