[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 39e0062235 46/77: Introduce face and keyword cla
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 39e0062235 46/77: Introduce face and keyword class for underlined text |
Date: |
Fri, 26 Aug 2022 16:06:36 -0400 (EDT) |
branch: externals/auctex
commit 39e006223516b15cf039923bb16c56e5a9070c08
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>
Introduce face and keyword class for underlined text
* doc/auctex.texi (Fontification of macros): Describe the keyword
list `font-latex-match-underline-command-keywords'. Add
"underline-command" to description of user option
`font-latex-deactivated-keyword-classes'.
* doc/changes.texi: Announce the new face.
* font-latex.el (font-latex-built-in-keyword-classes): Introduce
new keyword classs "underline-command" incl. the builtin macro.
(font-latex-deactivated-keyword-classes)
(font-latex-add-keywords): Adjust docstrings accordingly.
(font-latex-underline-face): New face for underlined text.
* style/ulem.el ("ulem"): Use new keyword class for macros
provided by the package.
Co-authored-by: Hendrik Rommeswinkel <rommeswi@proton.me>
Copyright-paperwork-exempt: yes
---
doc/auctex.texi | 6 +++++-
doc/changes.texi | 12 ++++++++++++
font-latex.el | 27 ++++++++++++++++++++++-----
style/ulem.el | 7 ++++---
4 files changed, 43 insertions(+), 9 deletions(-)
diff --git a/doc/auctex.texi b/doc/auctex.texi
index a2a0452555..e673f1b3ea 100644
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -2211,6 +2211,7 @@ your own macros which are listed in the table below.
@vindex font-latex-match-bold-command-keywords
@vindex font-latex-match-italic-command-keywords
+@vindex font-latex-match-underline-command-keywords
@vindex font-latex-match-math-command-keywords
@vindex font-latex-match-type-command-keywords
@vindex font-latex-match-bold-declaration-keywords
@@ -2223,6 +2224,9 @@ Face: @code{font-latex-bold-face}
@item font-latex-match-italic-command-keywords
Keywords for commands specifying an italic font.@*
Face: @code{font-latex-italic-face}
+@item font-latex-match-underline-command-keywords
+Keywords for commands specifying an underlined text.@*
+Face: @code{font-latex-underline-face}
@item font-latex-match-math-command-keywords
Keywords for commands specifying a math font.@*
Face: @code{font-latex-math-face}
@@ -2251,7 +2255,7 @@ 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",
-"math-command", "type-command", "bold-declaration",
+"underline-command", "math-command", "type-command", "bold-declaration",
"italic-declaration", "type-declaration".
You can also get rid of certain keywords only. For example if you want
diff --git a/doc/changes.texi b/doc/changes.texi
index c02947168b..6c0a572316 100644
--- a/doc/changes.texi
+++ b/doc/changes.texi
@@ -11,6 +11,18 @@
@heading News since last release
@itemize @bullet
+@item
+@AUCTeX{} underlines the argument of macros which produce underlined text
+in the final product with @code{font-latex-underline-face}. The
+corresponding keyword class is called @code{underline-command}.
+@ifset rawfile
+See the section for fontification of macros
+@end ifset
+@ifclear rawfile
+@xref{Fontification of macros}
+@end ifclear
+if you dislike this feature and wish to deactivate it.
+
@item
Support for the Sioyek document viewer is added.
diff --git a/font-latex.el b/font-latex.el
index 92b6047a7b..111d8e9354 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -431,6 +431,9 @@ variable `font-latex-fontify-sectioning'." ',num)
("italic-command"
(("emph" "{") ("textit" "{") ("textsl" "{") ("mathit" "{"))
font-latex-italic-face 1 command)
+ ("underline-command"
+ (("underline" "{"))
+ font-latex-underline-face 1 command)
("math-command"
(("ensuremath" "|{\\"))
font-latex-math-face 1 command)
@@ -481,9 +484,9 @@ 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\", \"math-command\",
-\"type-command\", \"bold-declaration\", \"italic-declaration\",
-\"type-declaration\".
+\"bold-command\", \"italic-command\", \"underline-command\",
+\"math-command\", \"type-command\", \"bold-declaration\",
+\"italic-declaration\", \"type-declaration\".
You have to restart Emacs for a change of this variable to take effect."
:group 'font-latex-keywords
@@ -913,8 +916,8 @@ symbols `warning', `variable', `reference', `biblatexnoarg',
`biblatex', `function', `sectioning-0', `sectioning-1',
`sectioning-2', `sectioning-3', `sectioning-4', `sectioning-5',
`slide-title', `textual', `bold-command', `italic-command',
-`math-command', `type-command', `bold-declaration',
-`italic-declaration' or `type-declaration'.
+`underline-command', `math-command', `type-command',
+`bold-declaration', `italic-declaration' or `type-declaration'.
The keywords will be added to the buffer-local list of keywords
of the respective keyword class and necessary updates of the font
@@ -1143,6 +1146,20 @@ have changed."
"Face used to highlight text to be typeset in italic."
:group 'font-latex-highlighting-faces)
+(defface font-latex-underline-face
+ (let ((font '(:inherit underline)))
+ `((((class grayscale) (background light))
+ (:foreground "DimGray" ,@font))
+ (((class grayscale) (background dark))
+ (:foreground "LightGray" ,@font))
+ (((class color) (background light))
+ (:foreground "DarkOliveGreen" ,@font))
+ (((class color) (background dark))
+ (:foreground "OliveDrab" ,@font))
+ (t (,@font))))
+ "Face used to highlight text to be underlined."
+ :group 'font-latex-highlighting-faces)
+
(defface font-latex-math-face
(let ((font '(:inherit underline)))
`((((class grayscale) (background light))
diff --git a/style/ulem.el b/style/ulem.el
index cfb6105e29..fa9cefb066 100644
--- a/style/ulem.el
+++ b/style/ulem.el
@@ -69,14 +69,15 @@
;; Tell font-lock about the update.
(font-latex-add-keywords '(("useunder" "{{{"))
'function)
+ (font-latex-add-keywords '(("sout" "{")
+ ("xout" "{"))
+ 'textual)
(font-latex-add-keywords '(("uline" "{")
("uuline" "{")
("uwave" "{")
- ("sout" "{")
- ("xout" "{")
("dashuline" "{")
("dotuline" "{"))
- 'textual)))
+ 'underline-command)))
TeX-dialect)
(defvar LaTeX-ulem-fontdecl
- [elpa] externals/auctex 3a1a820bdf 18/77: ; Rearrange code after last commit., (continued)
- [elpa] externals/auctex 3a1a820bdf 18/77: ; Rearrange code after last commit., Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 9b5cf4b550 27/77: Fix insertion of second optional argument, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 4770d57dba 38/77: Support different number of arguments for \hyperref, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex e3657144f5 53/77: Partial fix of region preview with TeX-output-dir feature, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex edabf207b4 65/77: Insert a space between \caption and \\ in tables, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 812368af6a 62/77: Update documentation about C-M-a and C-M-e, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 728db25bf7 69/77: Update documentation, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex f2138e9a74 33/77: New option for saving auto parsed information (bug#55511), Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 5c5aa78de0 71/77: Fix doc string, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex c39fe6d1d6 13/77: Delete compatibility code, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 39e0062235 46/77: Introduce face and keyword class for underlined text,
Tassilo Horn <=