We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ae71870 commit a4b0693Copy full SHA for a4b0693
php-mode.el
@@ -1790,8 +1790,23 @@ The output will appear in the buffer *PHP*."
1790
1791
1792
;;;###autoload
1793
-(dolist (pattern '("\\.php[s345t]?\\'" "/\\.php_cs\\(\\.dist\\)?\\'" "\\.phtml\\'" "/Amkfile\\'" "\\.amk\\'"))
1794
- (add-to-list 'auto-mode-alist `(,pattern . php-mode) t))
+(add-to-list 'auto-mode-alist
+ (cons
1795
+ (eval-when-compile
1796
+ (rx (or
1797
+ ;; File name extensions (ex. "*.php", "*.phtml")
1798
+ (: "."
1799
+ (or (: "php" (? (in "s345t")))
1800
+ "amk"
1801
+ "phtml"))
1802
+ ;; Full file names (ex. "/Makefile", "/Amkfile")
1803
+ (: "/"
1804
+ (or "Amkfile"
1805
+ ".php_cs"
1806
+ ".php_cs.dist")))
1807
+ string-end))
1808
+ 'php-mode)
1809
+ t)
1810
1811
(provide 'php-mode)
1812
0 commit comments