auctex-diffs
[Top][All Lists]
Advanced

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

master 93fa8bde: Introduce new fontification keywords class "function-no


From: Arash Esbati
Subject: master 93fa8bde: Introduce new fontification keywords class "function-noarg"
Date: Tue, 9 May 2023 13:43:00 -0400 (EDT)

branch: master
commit 93fa8bde5740ad02dd21a08058cb36aa2ed13a39
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>

    Introduce new fontification keywords class "function-noarg"
    
    * doc/auctex.texi (Fontification of macros): Document new keywords
    class.
    
    * font-latex.el (font-latex-built-in-keyword-classes): Add new
    keywords class "function-noarg" and move the respective macros in
    this class.
    (font-latex-deactivated-keyword-classes)
    (font-latex-add-keywords): Mention new class in the docstrings.
---
 doc/auctex.texi |  6 +++---
 font-latex.el   | 47 ++++++++++++++++++++++++-----------------------
 2 files changed, 27 insertions(+), 26 deletions(-)

diff --git a/doc/auctex.texi b/doc/auctex.texi
index b396e397..8d5b282f 100644
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -12,7 +12,7 @@ This manual is for @AUCTeX{}
 (version @value{VERSION} from @value{UPDATED}),
 a sophisticated @TeX{} environment for Emacs.
 
-Copyright @copyright{} 1992-1995, 2001, 2002, 2004-2022
+Copyright @copyright{} 1992-1995, 2001, 2002, 2004-2023
 Free Software Foundation, Inc.
 
 @quotation
@@ -2317,11 +2317,11 @@ described above.  You can disable these defaults per 
class by
 customizing the variable @code{font-latex-deactivated-keyword-classes}.
 This is a list of strings for keyword classes to be deactivated.  Valid
 entries are "warning", "variable", "biblatexnoarg", "biblatex",
-"reference", "function" , "sectioning-0", "sectioning-1",
+"reference", "function", "function-noarg", "sectioning-0", "sectioning-1",
 "sectioning-2", "sectioning-3", "sectioning-4", "sectioning-5",
 "slide-title", "textual", "bold-command", "italic-command",
 "underline-command", "math-command", "type-command", "bold-declaration",
-"italic-declaration", "type-declaration".
+"italic-declaration" or "type-declaration".
 
 You can also get rid of certain keywords only.  For example if you want
 to remove highlighting of footnotes as references you can put the
diff --git a/font-latex.el b/font-latex.el
index ee6d06f8..91714b32 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -1,6 +1,6 @@
 ;;; font-latex.el --- LaTeX fontification for Font Lock mode.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 1996-2022  Free Software Foundation, Inc.
+;; Copyright (C) 1996-2023  Free Software Foundation, Inc.
 
 ;; Authors:    Peter S. Galbraith <psg@debian.org>
 ;;             Simon Marshall <Simon.Marshall@esrin.esa.it>
@@ -365,22 +365,22 @@ variable `font-latex-fontify-sectioning'." ',num)
       ("labelformat" "{{") ("linespread" "{")
       ("AddToHook" "{[{") ("RemoveFromHook" "{[") ("AddToHookNext" "{{")
       ("ProvidesClass" "{[") ("ProvidesPackage" "{[") ("ProvidesFile" "{[")
-      ("NewMarkClass" "{")
-      ;; XXX: Should macros without arguments rather be listed in a
-      ;; separate category with 'noarg instead of 'command handling?
-      ("enspace" "") ("enskip" "") ("quad" "") ("qquad" "") ("nonumber" "")
-      ("bigskip" "") ("medskip" "")  ("smallskip" "")
-      ("thinspace" "")  ("negthinspace" "")
-      ("thicklines" "") ("thinlines" "")
-      ("noindent" "") ("hline" "") ("ldots" "")
-      ("centering" "") ("raggedright" "") ("raggedleft" "")
-      ("raggedbottom" "") ("flushbottom" "")
-      ("TeX" "") ("LaTeX" "") ("LaTeXe" "")
-      ("normalfont" "") ("normalshape" "")
-      ("tableofcontents" "") ("listoffigures" "") ("listoftables" "")
-      ("maketitle" "") ("makeindex" "") ("makeglossary" "")
-      ("sloppy" "") ("fussy" ""))
+      ("NewMarkClass" "{"))
      font-lock-function-name-face 2 command)
+    ("function-noarg"
+     ("enspace" "enskip" "quad" "qquad" "nonumber"
+      "bigskip" "medskip"  "smallskip"
+      "thinspace"  "negthinspace"
+      "thicklines" "thinlines"
+      "noindent" "hline" "ldots"
+      "centering" "raggedright" "raggedleft"
+      "raggedbottom" "flushbottom"
+      "TeX" "LaTeX" "LaTeXe"
+      "normalfont" "normalshape"
+      "tableofcontents" "listoffigures" "listoftables"
+      "maketitle" "makeindex" "makeglossary"
+      "sloppy" "fussy")
+     font-lock-keyword-face 2 noarg)
     ("sectioning-0"
      (("part" "*[{"))
      (if (eq font-latex-fontify-sectioning 'color)
@@ -482,12 +482,13 @@ will match macros of the form \"\\foo[bar]{baz}\"."))
   "List of strings for built-in keyword classes to be deactivated.
 
 Valid entries are \"warning\", \"variable\", \"biblatexnoarg\",
-\"biblatex\", \"reference\", \"function\" , \"sectioning-0\",
-\"sectioning-1\", \"sectioning-2\", \"sectioning-3\",
-\"sectioning-4\", \"sectioning-5\", \"slide-title\", \"textual\",
-\"bold-command\", \"italic-command\", \"underline-command\",
-\"math-command\", \"type-command\", \"bold-declaration\",
-\"italic-declaration\", \"type-declaration\".
+\"biblatex\", \"reference\", \"function\", \"function-noarg\",
+\"sectioning-0\", \"sectioning-1\", \"sectioning-2\",
+\"sectioning-3\", \"sectioning-4\", \"sectioning-5\",
+\"slide-title\", \"textual\", \"bold-command\",
+\"italic-command\", \"underline-command\", \"math-command\",
+\"type-command\", \"bold-declaration\", \"italic-declaration\" or
+\"type-declaration\".
 
 You have to restart Emacs for a change of this variable to take effect."
   :group 'font-latex-keywords
@@ -914,7 +915,7 @@ Generated by `font-latex-make-user-keywords'.")))
 KEYWORDS is a list of keywords or keywords with syntax specs.
 CLASS corresponds to a keyword class and can be one of the
 symbols `warning', `variable', `reference', `biblatexnoarg',
-`biblatex', `function', `sectioning-0', `sectioning-1',
+`biblatex', `function', `function-noarg', `sectioning-1',
 `sectioning-2', `sectioning-3', `sectioning-4', `sectioning-5',
 `slide-title', `textual', `bold-command', `italic-command',
 `underline-command', `math-command', `type-command',



reply via email to

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