From: Lars Ingebrigtsen Date: Wed, 20 Jan 2021 02:25:46 +0000 (+0100) Subject: Make sh-mode use `auto-mode-interpreter-regexp' X-Git-Tag: emacs-28.0.90~4202 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5aff1bfdaf6fb64b50087c93f212faa18fbe17fb;p=emacs.git Make sh-mode use `auto-mode-interpreter-regexp' * lisp/progmodes/sh-script.el (sh-mode): Use `auto-mode-interpreter-regexp' instead of open-coding the value (bug#17158). --- diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index a417de32640..d3692d47205 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -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.