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. 51cd5ea0bbf17a5ade02c


From: Arash Esbati
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 51cd5ea0bbf17a5ade02c1baa7a897375b1a34d7
Date: Fri, 11 Feb 2022 08:30:31 -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  51cd5ea0bbf17a5ade02c1baa7a897375b1a34d7 (commit)
      from  a3282bbe063a6bb880164441e2077ae9a7082a7a (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 51cd5ea0bbf17a5ade02c1baa7a897375b1a34d7
Author: Arash Esbati <arash@gnu.org>
Date:   Fri Feb 11 14:29:49 2022 +0100

    Improve fontification for LaTeX kernel macros
    
    * font-latex.el (font-latex-built-in-keyword-classes): Add
    fontification support for LaTeX kernel macros to various keyword
    classes.
    
    * tests/latex/font-latex-test.el
    (font-latex-general-fontification): Update test for fontification.

diff --git a/font-latex.el b/font-latex.el
index 65f43e68..8b1fec60 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -240,7 +240,9 @@ variable `font-latex-fontify-sectioning'." ',num)
   '(("warning"
      ("nopagebreak" "pagebreak" "newpage" "clearpage" "cleardoublepage"
       "enlargethispage" "nolinebreak" "linebreak" "newline" "-" "\\" "\\*"
-      "appendix" "displaybreak" "allowdisplaybreaks" "tabularnewline" 
"include")
+      "appendix" "displaybreak" "allowdisplaybreaks" "tabularnewline" "include"
+      "backmatter" "frontmatter" "mainmatter"
+      "makeatletter" "makeatother" "newblock" "suppressfloats" "endinput")
      font-latex-warning-face 1 noarg)
     ("variable"
      (("setlength" "|{\\{") ("settowidth" "|{\\{") ("settoheight" "{{")
@@ -351,13 +353,23 @@ variable `font-latex-fontify-sectioning'." ',num)
       ("newcounter" "{[") ("renewenvironment" "*{[[{{")
       ("renewcommand" "*|{\\[[{") ("renewtheorem" "{[{[")
       ("usepackage" "[{[") ("fbox" "{") ("mbox" "{") ("rule" "[{{")
+      ("framebox" "|[([{") ("makebox" "|[([{") ("newsavebox" "|{\\")
+      ("parbox" "[[[{{") ("savebox" "|{\\|[([{") ("sbox" "|{\\{")
+      ("usebox" "|{\\")
+      ("cline" "{") ("extracolsep" "{") ("multicolumn" "{{{")
+      ("linethickness" "{") ("multiput" "(({{") ("put" "({")
+      ("qbezier" "[(((") ("raisebox" "{[[{")
       ("addvspace" "{") ("vspace" "*{") ("hspace" "*{")
-      ("thinspace" "")  ("negthinspace" "")
+      ("addcontentsline" "{{{") ("addtocontents" "{{")
       ("labelformat" "{{")
       ("AddToHook" "{[{") ("RemoveFromHook" "{[") ("AddToHookNext" "{{")
       ;; 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" "")
       ("TeX" "") ("LaTeX" "") ("LaTeXe" "")
       ("normalfont" "") ("normalshape" "")
@@ -408,17 +420,19 @@ variable `font-latex-fontify-sectioning'." ',num)
      font-lock-type-face 2 command)
     ("bold-command"
      (("textbf" "{") ("textsc" "{") ("textssc" "{") ("textulc" "{")
-      ("textup" "{") ("textsw" "{") ("boldsymbol" "{") ("pmb" "{"))
+      ("textup" "{") ("textsw" "{") ("boldsymbol" "{") ("pmb" "{")
+      ("mathbf" "{"))
      font-latex-bold-face 1 command)
     ("italic-command"
-     (("emph" "{") ("textit" "{") ("textsl" "{"))
+     (("emph" "{") ("textit" "{") ("textsl" "{") ("mathit" "{"))
      font-latex-italic-face 1 command)
     ("math-command"
      (("ensuremath" "|{\\"))
      font-latex-math-face 1 command)
     ("type-command"
      (("texttt" "{") ("textsf" "{") ("textrm" "{") ("textmd" "{")
-      ("textnormal" "{") ("oldstylenums" "{") ("legacyoldstylenums" "{"))
+      ("textnormal" "{") ("oldstylenums" "{") ("legacyoldstylenums" "{")
+      ("mathrm" "{") ("mathsf" "{") ("mathtt" "{"))
      font-lock-type-face 1 command)
     ("bold-declaration"
      ("bf" "bfseries" "sc" "scshape" "sscshape" "ulcshape" "upshape" "swshape")
diff --git a/tests/latex/font-latex-test.el b/tests/latex/font-latex-test.el
index d619942c..9cc7ac52 100644
--- a/tests/latex/font-latex-test.el
+++ b/tests/latex/font-latex-test.el
@@ -108,6 +108,7 @@ $a$")
       (insert "\
 \\documentclass[10pt]{article}
 \\begin{document}
+
 \\section{Macros}
 Inline verbatim test:  \\verb|x|
 Inline math test:      $x$, \\(x\\)
@@ -122,28 +123,46 @@ Emphasize face test:   \\emph{x}
 Declarations test:     \\ttfamily x {\\ttfamily x}
                        \\itshape  x {\\itshape x}
                        \\bfseries x {\\bfseries x}
+
 \\section{Environments}
 \\subsection{Math}
+
 \\begin{math}
   x
 \\end{math}
+
 \\[
   x
 \\]
+
 \\[x\\]
+
 \\begin{displaymath}
   x
 \\end{displaymath}
+
 \\begin{equation}
   x
 \\end{equation}
+
 \\subsection{Misc.}
+
 \\begin{verbatim}
 x
 \\end{verbatim}
+
 \\begin{description}
 \\item[x] x
 \\end{description}
+
+\\section{Box commands}
+
+\\newsavebox\\mysavebox
+\\savebox{\\mysavebox}[30mm][r]{This is my box}
+\\savebox{\\mysavebox}(0,0)[l]{This is my box}
+
+\\parbox[m][3cm][c]{2cm}{Some Text}
+
 \\end{document}
 
 %%% Local Variables:
@@ -155,7 +174,7 @@ x
       (goto-char (point-min))
 
       ;; Test for \documentclass:
-      (search-forward-regexp "\\\\document\\(?1:c\\)lass\\[")
+      (re-search-forward "\\\\document\\(?1:c\\)lass\\[")
       (should (font-latex-faces-present-p 'font-lock-keyword-face
                                           (match-beginning 1)))
       (forward-char)
@@ -168,7 +187,7 @@ x
       (end-of-line)
 
       ;; Test for \section macro itself:
-      (search-forward-regexp "\\\\sec\\(?1:t\\)ion{")
+      (re-search-forward "\\\\sec\\(?1:t\\)ion{")
       (should (font-latex-faces-present-p 'font-lock-keyword-face
                                           (match-beginning 1)))
       (goto-char (match-end 0))
@@ -233,7 +252,7 @@ x
       (end-of-line)
 
       ;; Test for math environments:
-      (search-forward-regexp "\\\\be\\(?1:g\\)in{ma\\(?2:t\\)h}")
+      (re-search-forward "\\\\be\\(?1:g\\)in{ma\\(?2:t\\)h}")
       (should (font-latex-faces-present-p 'font-lock-keyword-face
                                           (match-beginning 1)))
       (should (font-latex-faces-present-p 'font-lock-function-name-face
@@ -271,11 +290,58 @@ x
       (LaTeX-find-matching-end)
 
       ;; Check the fontification of \item macro itself:
-      (search-forward-regexp "\\\\it\\(?1:e\\)m\\[")
+      (re-search-forward "\\\\it\\(?1:e\\)m\\[")
       (should (font-latex-faces-present-p 'font-lock-keyword-face
                                           (match-beginning 1)))
       ;; Now for the optional argument:
       (should (font-latex-faces-present-p 'font-lock-variable-name-face))
-      (LaTeX-find-matching-end)  )))
+      (LaTeX-find-matching-end)
+
+      ;; Test for boxing commands
+      (re-search-forward "\\\\news\\(?1:a\\)vebox")
+      (should (font-latex-faces-present-p 'font-lock-keyword-face
+                                          (match-beginning 1)))
+      (re-search-forward "\\\\mys\\(?1:a\\)vebox")
+      (should (font-latex-faces-present-p 'font-lock-function-name-face
+                                          (match-beginning 1)))
+      ;; Test for the fontification in braces '{\mysavebox}':
+      (re-search-forward "{\\\\mys\\(?1:a\\)ve")
+      (should (font-latex-faces-present-p 'font-lock-function-name-face
+                                          (match-beginning 1)))
+      ;; Now for the optionals arguments of '\savebox':
+      (re-search-forward "\\[\\(?1:[^]]+\\)\\]\\[\\(?2:[^]]+\\)\\]{")
+      (should (font-latex-faces-present-p 'font-lock-variable-name-face
+                                          (match-beginning 1)))
+      (should (font-latex-faces-present-p 'font-lock-variable-name-face
+                                          (match-beginning 2)))
+      (should (font-latex-faces-present-p 'font-lock-function-name-face
+                                          (match-end 0)))
+      (end-of-line)
+
+      ;; Test for the optional arguments of '\savebox' which look
+      ;; different for 'picture' environments:
+      (re-search-forward "(\\(?1:.\\),\\(?2:.\\))\\[\\(?3:[^]]+\\)\\]{")
+      (should (font-latex-faces-present-p 'font-lock-variable-name-face
+                                          (match-beginning 1)))
+      (should (font-latex-faces-present-p 'font-lock-variable-name-face
+                                          (match-beginning 2)))
+      (should (font-latex-faces-present-p 'font-lock-variable-name-face
+                                          (match-beginning 3)))
+      (should (font-latex-faces-present-p 'font-lock-function-name-face
+                                          (match-end 0)))
+
+      ;; Test for \parbox and its arguments:
+      (re-search-forward
+       
"\\\\p\\(?1:a\\)rbox\\[\\(?2:[^]]+\\)\\]\\[\\(?3:[^]]+\\)\\]\\[\\(?4:[^]]+\\)\\]{")
+      (should (font-latex-faces-present-p 'font-lock-keyword-face
+                                          (match-beginning 1)))
+      (should (font-latex-faces-present-p 'font-lock-variable-name-face
+                                          (match-beginning 2)))
+      (should (font-latex-faces-present-p 'font-lock-variable-name-face
+                                          (match-beginning 3)))
+      (should (font-latex-faces-present-p 'font-lock-variable-name-face
+                                          (match-beginning 4)))
+      (should (font-latex-faces-present-p 'font-lock-function-name-face
+                                          (match-end 0)))  )))
 
 ;;; font-latex-test.el ends here

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

Summary of changes:
 font-latex.el                  | 24 ++++++++++---
 tests/latex/font-latex-test.el | 76 +++++++++++++++++++++++++++++++++++++++---
 2 files changed, 90 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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