]> git.eshelyaron.com Git - emacs.git/commitdiff
Make sh-mode use `auto-mode-interpreter-regexp'
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 20 Jan 2021 02:25:46 +0000 (03:25 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 20 Jan 2021 02:25:46 +0000 (03:25 +0100)
* lisp/progmodes/sh-script.el (sh-mode): Use
`auto-mode-interpreter-regexp' instead of open-coding the value
(bug#17158).

lisp/progmodes/sh-script.el

index a417de32640429e0096c65e014c7a8610e7e9659..d3692d47205c8cc9eebd7cd49bbbe4dc5cad2395 100644 (file)
@@ -1556,7 +1556,7 @@ with your script for an edit-interpret-debug cycle."
   (sh-set-shell
    (cond ((save-excursion
             (goto-char (point-min))
-            (looking-at "#![ \t]?\\([^ \t\n]*/bin/env[ \t]\\)?\\([^ \t\n]+\\)"))
+            (looking-at auto-mode-interpreter-regexp))
           (match-string 2))
          ((not buffer-file-name) sh-shell-file)
          ;; Checks that use `buffer-file-name' follow.