monnier pushed a commit to branch externals/auctex
in repository elpa.
commit a8043a2d7dceae42a8e09af9e707d20deaa5f241
Author: Tassilo Horn <[email protected]>
Date: Wed Jan 22 14:09:04 2014 +0100
Fix syntactic fontification.
* style/shortvrb.el (LaTeX-shortvrb-chars): Move from
tex-style.el. Set default value to nil because just loading
shortvrb does not make | a shortvrb char. One needs to define it
using \MakeShortVrb{\|}. Extend the docstring so that it tells
that one should usually set this variable only buffer-locally.
* font-latex.el (font-latex-add-to-syntax-alist): Call
`font-latex-setup' to make syntactic font-lock changes effective.
---
ChangeLog | 11 +++++++++++
font-latex.el | 7 +------
style/shortvrb.el | 22 ++++++++++++++++++++++
tex-style.el | 7 -------
4 files changed, 34 insertions(+), 13 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 14cb224..215f37e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2014-01-22 Tassilo Horn <[email protected]>
+
+ * style/shortvrb.el (LaTeX-shortvrb-chars): Move from
+ tex-style.el. Set default value to nil because just loading
+ shortvrb does not make | a shortvrb char. One needs to define it
+ using \MakeShortVrb{\|}. Extend the docstring so that it tells
+ that one should usually set this variable only buffer-locally.
+
+ * font-latex.el (font-latex-add-to-syntax-alist): Call
+ `font-latex-setup' to make syntactic font-lock changes effective.
+
2014-01-21 Berend de Boer <[email protected]>
* context.el: distinguish between numbered and unnumbered sections.
diff --git a/font-latex.el b/font-latex.el
index 6f07766..33eb1ad 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -1127,14 +1127,9 @@ triggers Font Lock to recognize the change."
(make-local-variable 'font-latex-syntax-alist)
(set (make-local-variable 'font-latex-syntax-alist)
(append font-latex-syntax-alist list))
-;; FIXME: Are there situations where we need to alter `font-lock-defaults'
-;; directly?
-;; (dolist (entry list)
-;; (setcar (cdddr font-lock-defaults)
-;; (cons entry (cadddr font-lock-defaults))))
;; Tell font-lock about the update.
(setq font-lock-set-defaults nil)
- (font-lock-set-defaults))
+ (font-latex-setup))
;;;###autoload
(defun font-latex-setup ()
diff --git a/style/shortvrb.el b/style/shortvrb.el
index 2ef191a..8b4570a 100644
--- a/style/shortvrb.el
+++ b/style/shortvrb.el
@@ -41,6 +41,28 @@
;;; Code:
+(defcustom LaTeX-shortvrb-chars nil
+ "List of characters toggling verbatim mode.
+When your document uses the shortvrb style and you have a
+\\MakeShortVrb{\\|} in your file to write verbatim text as
+|text|, then set this variable to the list (?|). Then AUCTeX
+fontifies |text| as verbatim.
+
+Preferably, you should do this buffer-locally using a file
+variable near the end of your document like so:
+
+ %% Local Variables:
+ %% LaTeX-shortvrb-chars: (?|)
+ %% End:
+
+When you customize this variable to a non-nil value, then it
+becomes the default value meaning that verbatim fontification is
+always performed for the characters in the list, no matter if
+your document actually defines shortvrb chars using
+\\MakeShortVrb."
+ :group 'LaTeX-style
+ :type '(repeat character))
+
(TeX-add-style-hook
"shortvrb"
(lambda ()
diff --git a/tex-style.el b/tex-style.el
index b403db1..9975b3f 100644
--- a/tex-style.el
+++ b/tex-style.el
@@ -380,13 +380,6 @@ Inserting the subdirectory in the filename (as
(TeX-master-directory))))
(function :tag "other")))
-;; style/shortvrb.el
-
-(defcustom LaTeX-shortvrb-chars '(?|)
- "List of characters toggling verbatim mode."
- :group 'LaTeX-style
- :type '(repeat character))
-
(provide 'tex-style)
;;; tex-style.el ends here