diff options
| -rw-r--r-- | lisp/files.el | 8 | ||||
| -rw-r--r-- | test/lisp/files-tests.el | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/lisp/files.el b/lisp/files.el index f67b650cb92..5098d49048e 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -3274,7 +3274,13 @@ and `inhibit-local-variables-suffixes'. If | |||
| 3274 | ;; Optional group 1: env(1) invocation. | 3274 | ;; Optional group 1: env(1) invocation. |
| 3275 | "\\(" | 3275 | "\\(" |
| 3276 | "[^ \t\n]*/bin/env[ \t]*" | 3276 | "[^ \t\n]*/bin/env[ \t]*" |
| 3277 | "\\(?:-S[ \t]*\\|--split-string\\(?:=\\|[ \t]*\\)\\)?" | 3277 | ;; Within group 1: possible -S/--split-string. |
| 3278 | "\\(?:" | ||
| 3279 | ;; -S/--split-string | ||
| 3280 | "\\(?:-[0a-z]*S[ \t]*\\|--split-string=\\)" | ||
| 3281 | ;; More env arguments. | ||
| 3282 | "\\(?:-[^ \t\n]+[ \t]+\\)*" | ||
| 3283 | "\\)?" | ||
| 3278 | "\\)?" | 3284 | "\\)?" |
| 3279 | ;; Group 2: interpreter. | 3285 | ;; Group 2: interpreter. |
| 3280 | "\\([^ \t\n]+\\)")) | 3286 | "\\([^ \t\n]+\\)")) |
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el index 23516ff0d7d..0a5c3b897e4 100644 --- a/test/lisp/files-tests.el +++ b/test/lisp/files-tests.el | |||
| @@ -1687,8 +1687,14 @@ set to." | |||
| 1687 | (files-tests--check-shebang "#!/usr/bin/env python" 'python-base-mode) | 1687 | (files-tests--check-shebang "#!/usr/bin/env python" 'python-base-mode) |
| 1688 | (files-tests--check-shebang "#!/usr/bin/env python3" 'python-base-mode) | 1688 | (files-tests--check-shebang "#!/usr/bin/env python3" 'python-base-mode) |
| 1689 | ;; Invocation through env, with supplementary arguments. | 1689 | ;; Invocation through env, with supplementary arguments. |
| 1690 | (files-tests--check-shebang "#!/usr/bin/env --split-string=bash -eux" 'sh-base-mode 'bash) | ||
| 1691 | (files-tests--check-shebang "#!/usr/bin/env --split-string=-iv --default-signal bash -eux" 'sh-base-mode 'bash) | ||
| 1690 | (files-tests--check-shebang "#!/usr/bin/env -S awk -v FS=\"\\t\" -v OFS=\"\\t\" -f" 'awk-mode) | 1692 | (files-tests--check-shebang "#!/usr/bin/env -S awk -v FS=\"\\t\" -v OFS=\"\\t\" -f" 'awk-mode) |
| 1691 | (files-tests--check-shebang "#!/usr/bin/env -S make -f" 'makefile-mode)) | 1693 | (files-tests--check-shebang "#!/usr/bin/env -S make -f" 'makefile-mode) |
| 1694 | (files-tests--check-shebang "#!/usr/bin/env -S-vi bash -eux" 'sh-base-mode 'bash) | ||
| 1695 | (files-tests--check-shebang "#!/usr/bin/env -ivS --default-signal=INT bash -eux" 'sh-base-mode 'bash) | ||
| 1696 | (files-tests--check-shebang "#!/usr/bin/env -ivS --default-signal bash -eux" 'sh-base-mode 'bash) | ||
| 1697 | (files-tests--check-shebang "#!/usr/bin/env -vS -uFOOBAR bash -eux" 'sh-base-mode 'bash)) | ||
| 1692 | 1698 | ||
| 1693 | (ert-deftest files-test-dir-locals-auto-mode-alist () | 1699 | (ert-deftest files-test-dir-locals-auto-mode-alist () |
| 1694 | "Test an `auto-mode-alist' entry in `.dir-locals.el'" | 1700 | "Test an `auto-mode-alist' entry in `.dir-locals.el'" |