auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] GNU AUCTeX branch, master, updated. 78c0f0961941178aad974


From: Arash Esbati
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 78c0f0961941178aad974e721e7964482ab9bbad
Date: Mon, 4 Mar 2019 15:13:27 -0500 (EST)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU AUCTeX".

The branch, master has been updated
       via  78c0f0961941178aad974e721e7964482ab9bbad (commit)
      from  3543e45b30558f112a14f148ba631138da13dcfe (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 78c0f0961941178aad974e721e7964482ab9bbad
Author: Arash Esbati <address@hidden>
Date:   Mon Mar 4 21:12:18 2019 +0100

    Fix fontification of simple macros
    
    * font-latex.el (font-latex-match-simple-command): Change second
    part of regexp in order to be less greedy.  This function now
    fontifies only letters and characters defined in
    `font-latex-match-simple-include-list' (bug#34712).
    (font-latex-match-simple-include-list): New variable.
    
    * style/expl3.el ("expl3"): Add "_" and ":" to
    `font-latex-match-simple-include-list'.

diff --git a/font-latex.el b/font-latex.el
index bd504a8..8e8b4fc 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -1,6 +1,6 @@
 ;;; font-latex.el --- LaTeX fontification for Font Lock mode.
 
-;; Copyright (C) 1996-2017  Free Software Foundation, Inc.
+;; Copyright (C) 1996-2019  Free Software Foundation, Inc.
 
 ;; Authors:    Peter S. Galbraith <address@hidden>
 ;;             Simon Marshall <address@hidden>
@@ -1714,6 +1714,14 @@ marks boundaries for searching for group ends."
   "List of characters directly after \"\\\" excluded from fontification.
 Each character is a string.")
 
+(defvar font-latex-match-simple-include-list '("@")
+  "List of characters allowed in a macro for fontification.
+Each character is a string.  This variable is initialized to
+\"@\" since internal LaTeX commands are very often redefined in a
+.tex file and the fontification should work correctly in those
+cases.")
+(make-variable-buffer-local 'font-latex-match-simple-include-list)
+
 (defun font-latex-match-simple-command (limit)
   "Search for command like \\foo before LIMIT."
   ;; \s_ matches chars with symbol syntax, \sw chars with word syntax,
@@ -1726,7 +1734,20 @@ Each character is a string.")
   ;; like `\__module_foo:nnn'
   (let* ((search (lambda ()
                   (TeX-re-search-forward-unescaped
-                   "\\\\\\(\\s_\\|\\sw\\|\\s.\\)\\(?:\\s_\\|\\sw\\)*" limit 
t)))
+                   (concat
+                     ;; Chars directly after backslash
+                     "\\\\\\(\\s_\\|\\sw\\|\\s.\\)"
+                     ;; Start group of the following chars
+                     "\\(?:["
+                     ;; a-zA-Z are always allowed:
+                     "a-zA-Z"
+                     ;; Additional characters added by AUCTeX styles
+                     (mapconcat #'identity
+                                  font-latex-match-simple-include-list
+                                  "")
+                     ;; End group
+                     "]\\)*")
+                   limit t)))
         (pos (funcall search)))
     (while (and pos
                (member (match-string 1)
diff --git a/style/expl3.el b/style/expl3.el
index c1bb029..4fdea24 100644
--- a/style/expl3.el
+++ b/style/expl3.el
@@ -1,6 +1,6 @@
 ;;; expl3.el --- AUCTeX style for `expl3.sty'
 
-;; Copyright (C) 2015, 2017, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2017-2019 Free Software Foundation, Inc.
 
 ;; Author: Tassilo Horn <address@hidden>
 ;; Maintainer: address@hidden
@@ -48,6 +48,9 @@
    (set-syntax-table LaTeX-expl3-syntax-table)
    (when (and (fboundp 'font-latex-update-font-lock)
              (eq TeX-install-font-lock 'font-latex-setup))
+     ;; Fontify _ and : as part of macros.
+     (add-to-list 'font-latex-match-simple-include-list "_" t)
+     (add-to-list 'font-latex-match-simple-include-list ":" t)
      ;; Tell font-lock about the update.
      (font-latex-update-font-lock t)))
  LaTeX-dialect)

-----------------------------------------------------------------------

Summary of changes:
 font-latex.el  | 25 +++++++++++++++++++++++--
 style/expl3.el |  5 ++++-
 2 files changed, 27 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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