branch: elpa/web-mode
commit c40fdcc91ed4bc1773531be3b6bfcbb9b1a0303c
Merge: 848fce94de 42c64bcb7e
Author: fxbois <[email protected]>
Commit: GitHub <[email protected]>

    Merge pull request #1287 from georgek/fix-dir-locals
    
    Fix dir locals
---
 web-mode.el | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/web-mode.el b/web-mode.el
index f573d4d967..f1c2e24ef7 100644
--- a/web-mode.el
+++ b/web-mode.el
@@ -421,6 +421,15 @@ by a li open tag is valid)."
   :type '(repeat string)
   :group 'web-mode)
 
+(defcustom web-mode-engines-alist nil
+  "A list of filename patterns and corresponding `web-mode' engine.
+For example,
+\(setq web-mode-engines-alist
+       \\='((\"php\"    . \"\\\\.phtml\\\\\\='\")
+         (\"blade\"  . \"\\\\.blade\\\\.\")))"
+  :type '(alist :key-type string :value-type string)
+  :group 'web-mode)
+
 ;;---- FACES 
-------------------------------------------------------------------
 
 (defface web-mode-error-face
@@ -1100,13 +1109,6 @@ For example,
   \\='((\"json\" . \"/some/path/.*\\.api\\\\='\")
     (\"jsx\"  . \"/some/react/path/.*\\.js[x]?\\\\='\")))")
 
-(defvar web-mode-engines-alist nil
-  "A list of filename patterns and corresponding `web-mode' engine.
-For example,
-\(setq web-mode-engines-alist
-       \\='((\"php\"    . \"\\\\.phtml\\\\\\='\")
-         (\"blade\"  . \"\\\\.blade\\\\.\")))")
-
 (defvar web-mode-smart-quotes
   '("«" . "»")
   "Preferred smart quotes")
@@ -2901,6 +2903,7 @@ another auto-completion with different ac-sources (e.g. 
ac-php)")
     (add-hook 'after-save-hook        #'web-mode-on-after-save t t)
     (add-hook 'change-major-mode-hook #'web-mode-on-exit nil t)
     (add-hook 'post-command-hook      #'web-mode-on-post-command nil t)
+    (add-hook 'hack-local-variables-hook 
#'web-mode-guess-engine-and-content-type t t)
 
     (cond
       ((boundp 'yas-after-exit-snippet-hook)
@@ -2919,7 +2922,6 @@ another auto-completion with different ac-sources (e.g. 
ac-php)")
     (when web-mode-enable-sexp-functions
       (setq-local forward-sexp-function #'web-mode-forward-sexp))
 
-    (web-mode-guess-engine-and-content-type)
     (setq web-mode-change-beg (point-min)
           web-mode-change-end (point-max))
     (when (> (point-max) 256000)

Reply via email to