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

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

[elpa] externals/auctex d54e747 19/95: Fix font-latex-after-hacking-loca


From: Tassilo Horn
Subject: [elpa] externals/auctex d54e747 19/95: Fix font-latex-after-hacking-local-variables on XEmacs
Date: Sun, 16 Apr 2017 01:26:47 -0400 (EDT)

branch: externals/auctex
commit d54e7472dcc017aab135819efb899ab2dacb9a4f
Author: Tassilo Horn <address@hidden>
Commit: Tassilo Horn <address@hidden>

    Fix font-latex-after-hacking-local-variables on XEmacs
    
    * font-latex.el (font-latex-after-hacking-local-variables): Cater for the
    fact that file-local-variables-alist isn't there in XEmacs and older
    Emacs versions (bug#25564).
---
 font-latex.el | 28 ++++++++++++++++++++--------
 1 file changed, 20 insertions(+), 8 deletions(-)

diff --git a/font-latex.el b/font-latex.el
index 91cb0de..8100ded 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -1416,14 +1416,26 @@ modified.  Such variables include
 `LaTeX-verbatim-environments-local',
 `LaTeX-verbatim-macros-with-braces-local',
 `LaTeX-verbatim-macros-with-delims-local'."
-  ;; Note to self: directory-local variables are also added to
-  ;; file-local-variables-alist.
-  (let ((hacked-local-vars (mapcar #'car file-local-variables-alist)))
-    (when (or (memq 'LaTeX-verbatim-environments-local hacked-local-vars)
-             (memq 'LaTeX-verbatim-macros-with-braces-local hacked-local-vars)
-             (memq 'LaTeX-verbatim-macros-with-delims-local hacked-local-vars))
-      ;; Ok, we need to refresh fontification.
-      (font-latex-update-font-lock t))))
+  (when (if (boundp 'file-local-variables-alist)
+           ;; In Emacs we know if the value came from file or directory
+           ;; locals.  Note to self: directory-local variables are also added
+           ;; to file-local-variables-alist.
+           (let ((hacked-local-vars (mapcar #'car file-local-variables-alist)))
+             (or (memq 'LaTeX-verbatim-environments-local hacked-local-vars)
+                 (memq 'LaTeX-verbatim-macros-with-braces-local 
hacked-local-vars)
+                 (memq 'LaTeX-verbatim-macros-with-delims-local 
hacked-local-vars)))
+         ;; In XEmacs and old Emacs versions we don't know if a buffer-local
+         ;; variable has been set by a file-local variables block or somehow
+         ;; else.  So we trigger a refresh if any of those variables has a
+         ;; non-nil local binding.
+         (or (and LaTeX-verbatim-environments-local
+                  (local-variable-p LaTeX-verbatim-environments-local))
+             (and LaTeX-verbatim-macros-with-braces-local
+                  (local-variable-p LaTeX-verbatim-macros-with-braces-local))
+             (and LaTeX-verbatim-macros-with-delims-local
+                  (local-variable-p LaTeX-verbatim-macros-with-delims-local))))
+    ;; Ok, we need to refresh fontification.
+    (font-latex-update-font-lock t)))
 
 ;;; Utility functions
 



reply via email to

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