[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 214/299: Fix syntactic fontification.
From: |
Stefan Monnier |
Subject: |
[elpa] 214/299: Fix syntactic fontification. |
Date: |
Sun, 02 Nov 2014 03:11:31 +0000 |
monnier pushed a commit to branch externals/auctex
in repository elpa.
commit a8043a2d7dceae42a8e09af9e707d20deaa5f241
Author: Tassilo Horn <address@hidden>
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 <address@hidden>
+
+ * 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 <address@hidden>
* 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
- [elpa] 207/299: Add font name completion in fontspec.el., (continued)
- [elpa] 207/299: Add font name completion in fontspec.el., Stefan Monnier, 2014/11/01
- [elpa] 202/299: Disable electric-pair-mode conditionally., Stefan Monnier, 2014/11/01
- [elpa] 205/299: Handle package messages with parenthesized text., Stefan Monnier, 2014/11/01
- [elpa] 208/299: Use TeX-electric-math in LaTeX-math-insert/cal., Stefan Monnier, 2014/11/01
- [elpa] 199/299: Fix bindings of narrowing functions., Stefan Monnier, 2014/11/01
- [elpa] 209/299: Fix a bug with reftex where tex-info and LaTeX interferred., Stefan Monnier, 2014/11/01
- [elpa] 206/299: New style files and a fix to imakeidx.el., Stefan Monnier, 2014/11/01
- [elpa] 203/299: Skip comment or file in parens in output., Stefan Monnier, 2014/11/01
- [elpa] 211/299: Adapt style/babel.el to babel 3.9., Stefan Monnier, 2014/11/01
- [elpa] 210/299: Make search for \begin and \end case sensitive., Stefan Monnier, 2014/11/01
- [elpa] 214/299: Fix syntactic fontification.,
Stefan Monnier <=
- [elpa] 215/299: Declare LaTeX-shortvrb-chars as safe local variable., Stefan Monnier, 2014/11/01
- [elpa] 212/299: Distinguish between numbered and unnumbered sections., Stefan Monnier, 2014/11/01
- [elpa] 216/299: Add a ^L so that the file local variable example isn't picked up., Stefan Monnier, 2014/11/01
- [elpa] 217/299: Use default parameter of completing-read., Stefan Monnier, 2014/11/01
- [elpa] 218/299: Use default parameter of `completing-read'., Stefan Monnier, 2014/11/01
- [elpa] 213/299: *** empty log message ***, Stefan Monnier, 2014/11/01
- [elpa] 219/299: Add WHEN arg to make-obsolete calls, Stefan Monnier, 2014/11/01
- [elpa] 221/299: Add an english style., Stefan Monnier, 2014/11/01
- [elpa] 220/299: Convert TeX-auto-add-type to a macro., Stefan Monnier, 2014/11/01
- [elpa] 222/299: New variable to pass options to the TeX processor., Stefan Monnier, 2014/11/01