Skip to content

Commit b16d833

Browse files
committed
Remove interpreter-mode-alist for Emacs 24
1 parent acadfa8 commit b16d833

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

lisp/php-mode.el

+3-6
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,9 @@ enabled."
169169
:type 'boolean)
170170

171171
;;;###autoload
172-
(if (version< emacs-version "24.4")
173-
(dolist (i '("php" "php5" "php7"))
174-
(add-to-list 'interpreter-mode-alist (cons i 'php-mode)))
175-
(add-to-list 'interpreter-mode-alist
176-
;; Match php, php-3, php5, php7, php5.5, php-7.0.1, etc.
177-
(cons "php\\(?:-?[3457]\\(?:\\.[0-9]+\\)*\\)?" 'php-mode)))
172+
(add-to-list 'interpreter-mode-alist
173+
;; Match php, php-3, php5, php7, php5.5, php-7.0.1, etc.
174+
(cons "php\\(?:-?[34578]\\(?:\\.[0-9]+\\)*\\)?" 'php-mode))
178175

179176
(defcustom php-mode-hook nil
180177
"List of functions to be executed on entry to `php-mode'."

tests/php-mode-test.el

+2-4
Original file line numberDiff line numberDiff line change
@@ -568,15 +568,13 @@ style from Drupal."
568568

569569
(ert-deftest php-mode-test-issue-357 ()
570570
"Match version-specific interpreters."
571-
(dolist (on (if (version< emacs-version "24.4")
572-
'("php" "php5" "php7")
573-
'("php" "php3" "php5" "php7" "php-5" "php-5.5" "php7.0.1")))
571+
(dolist (on '("php" "php3" "php5" "php7" "php-5" "php-5.5" "php7.0.1"))
574572
(with-temp-buffer
575573
(insert "#!" on)
576574
(set-auto-mode)
577575
(should (eq 'php-mode major-mode))))
578576

579-
(dolist (off '("php2" "xphp5" "foo" "php8" "php7x"))
577+
(dolist (off '("php2" "xphp5" "foo" "php7x"))
580578
(with-temp-buffer
581579
(insert "#!" off)
582580
(set-auto-mode)

0 commit comments

Comments
 (0)