[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 243/299: Fix fontification of optional argument to verbatim envir
From: |
Stefan Monnier |
Subject: |
[elpa] 243/299: Fix fontification of optional argument to verbatim environments. |
Date: |
Sun, 02 Nov 2014 03:11:44 +0000 |
monnier pushed a commit to branch externals/auctex
in repository elpa.
commit 32fc9bd6eab8c3eff29d6b16b51859d445c12fbf
Author: Mosè Giordano <address@hidden>
Date: Thu May 1 23:21:11 2014 +0200
Fix fontification of optional argument to verbatim environments.
* font-latex.el (font-latex-set-syntactic-keywords): Fix
fontification of the optional argument to a verbatim-like
environment.
---
ChangeLog | 6 ++++++
font-latex.el | 16 ++++++++++++++--
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d5dc59f..56743ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-05-01 Mos� Giordano <address@hidden>
+
+ * font-latex.el (font-latex-set-syntactic-keywords): Fix
+ fontification of the optional argument to a verbatim-like
+ environment.
+
2014-04-16 Tassilo Horn <address@hidden>
* tex-buf.el (TeX-parse-error): Add another exception.
diff --git a/font-latex.el b/font-latex.el
index 33eb1ad..39be372 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -896,8 +896,20 @@ have changed."
font-latex-syntactic-keywords nil)
(unless (= (length verb-envs) 0)
(add-to-list 'font-latex-syntactic-keywords
- `(,(concat "^[ \t]*\\\\begin *{\\(?:" verb-envs
- "\\)}.*\\(\n\\)")
+ `(,(concat
+ "^[ \t]*\\\\begin *{\\(?:" verb-envs "\\)}"
+ ;; Some environments accept an optional argument that can
+ ;; span over more lines. Between "\begin{<envname>}" and
+ ;; the optional argument there can be whitespaces and the
+ ;; newline can be commented by a "%" character.
+ "[ \t]*\\(?:%.*\n[ \t]*\\)?"
+ ;; The following line of the regexp matches the optional
+ ;; argument and allows for up to one level of brackets
+ ;; inside the argument (e.g., the dialect of a language
+ ;; in the `lstlisting' environment by the `listings'
+ ;; package).
+ "\\(?:\\[[^\]\[]*\\(?:\\[[^\]\[]*\\][^\]\[]*\\)*\\]\\)?"
+ "\\(\n\\)")
(1 "|" t)))
(add-to-list 'font-latex-syntactic-keywords
;; Using the newline character for the syntax
- [elpa] 223/299: Prompt for packages inside LaTeX-env-document., (continued)
- [elpa] 223/299: Prompt for packages inside LaTeX-env-document., Stefan Monnier, 2014/11/01
- [elpa] 233/299: Prevent an infinite loop in TeX-command-expand., Stefan Monnier, 2014/11/01
- [elpa] 227/299: Fix missing quote., Stefan Monnier, 2014/11/01
- [elpa] 235/299: Enable TeX-PDF-mode by default., Stefan Monnier, 2014/11/01
- [elpa] 236/299: Add new style/exercise.el., Stefan Monnier, 2014/11/01
- [elpa] 231/299: Make TeX-completing-read-multiple return nil on empty input., Stefan Monnier, 2014/11/01
- [elpa] 239/299: Silence assignment to free variable warnings., Stefan Monnier, 2014/11/01
- [elpa] 240/299: Fix ChangeLog node for texinfo., Stefan Monnier, 2014/11/01
- [elpa] 242/299: Add another exception to error parsing., Stefan Monnier, 2014/11/01
- [elpa] 241/299: Resolve conflicts, Stefan Monnier, 2014/11/01
- [elpa] 243/299: Fix fontification of optional argument to verbatim environments.,
Stefan Monnier <=
- [elpa] 238/299: Use LaTeX-biblatex-use-Biber to manually select bibliography processor., Stefan Monnier, 2014/11/01
- [elpa] 246/299: Make style/babel.el file non-executable., Stefan Monnier, 2014/11/01
- [elpa] 234/299: Ask for TeX-master if unknown., Stefan Monnier, 2014/11/01
- [elpa] 244/299: Fix typo in listings.el., Stefan Monnier, 2014/11/01
- [elpa] 237/299: Update biblatex support in style file., Stefan Monnier, 2014/11/01
- [elpa] 250/299: Add TeX-previous-error to Command menu., Stefan Monnier, 2014/11/01
- [elpa] 247/299: Convert font-latex-fontify-sectioning to float when used as a number., Stefan Monnier, 2014/11/01
- [elpa] 252/299: Fix possible infinite loop in TeX-parse-all-errors., Stefan Monnier, 2014/11/01
- [elpa] 249/299: Backport from ELPA repository., Stefan Monnier, 2014/11/01
- [elpa] 245/299: Use TeX-esc as completion separator for units in siunitx.el., Stefan Monnier, 2014/11/01