emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/drupal-mode 430b04536e 176/308: Added special case for .tp


From: ELPA Syncer
Subject: [nongnu] elpa/drupal-mode 430b04536e 176/308: Added special case for .tpl.php extensions.
Date: Tue, 25 Jan 2022 10:59:45 -0500 (EST)

branch: elpa/drupal-mode
commit 430b04536e1980e9cbd7bbaac6ef45cf79526c06
Author: Arne Jørgensen <arne@arnested.dk>
Commit: Arne Jørgensen <arne@arnested.dk>

    Added special case for .tpl.php extensions.
---
 drupal/flymake-phpcs.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drupal/flymake-phpcs.el b/drupal/flymake-phpcs.el
index a75d76289a..d861bf3f22 100644
--- a/drupal/flymake-phpcs.el
+++ b/drupal/flymake-phpcs.el
@@ -49,8 +49,11 @@
     ;; version of `flymake-allowed-file-name-masks' and make
     ;; flymake-phpcs initialize.
     (make-local-variable 'flymake-allowed-file-name-masks)
-    (add-to-list 'flymake-allowed-file-name-masks
-                 `(,(concat "\\." (file-name-extension (or buffer-file-name 
(buffer-name))) "\\'") flymake-phpcs-init))
+    (let ((extension (file-name-extension (or buffer-file-name 
(buffer-name)))))
+      (when (string-match "\\.tpl\\.php\\'" (or buffer-file-name 
(buffer-name)))
+        (setq extension "tpl\\.php"))
+      (add-to-list 'flymake-allowed-file-name-masks
+                   `(,(concat "\\." extension "\\'") flymake-phpcs-init)))
     (flymake-mode 1)))
 
 (add-hook 'drupal-mode-hook #'drupal/flymake-phpcs-enable)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]