[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 ba6e5ef69c 07/77: ; Fix warnings reported by 'make dynvars-check', (continued)
- [elpa] externals/auctex ba6e5ef69c 07/77: ; Fix warnings reported by 'make dynvars-check', Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 4163bb5c42 66/77: Fix `autoconf` warnings, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 054b38887b 42/77: Fix (void-variable compilation-in-progress) error, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex b24dcb4feb 40/77: Track changes in LaTeX kernel 2022-06-01, 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 9a3078e510 68/77: Fix comments and doc strings, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 3447aa75c3 32/77: ; Further fixes about single quotes in docstrings, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 30f7a1ca68 63/77: Don't use void function texinfo-outline-level, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex fade32d568 54/77: Don't break line inside \verb-like macro (bug#56160), 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 39e0062235 46/77: Introduce face and keyword class for underlined text,
Tassilo Horn <=
- [elpa] externals/auctex d1d1bd819d 47/77: Control the opening and closing braces during insertion, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 6e25d11aa6 44/77: Add comment, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex ce4bb7c1b6 58/77: ; * style/doc.el: Delete spurious `declare-function'., Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 06db9e302b 75/77: Add new style/tcolorboxlib-theorems.el, 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 4486056d50 16/77: Add new style/ltcaption.el, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 019bcc9cc3 48/77: ; * style/proc.el: Fix a typo., Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 7d7e563862 34/77: * doc/changes.texi: Add NEWS item for the previous commit., Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 8404fe8b18 17/77: Provide generic completion functions, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex b377080c80 50/77: Add notification about xelatex in preview-latex doc, Tassilo Horn, 2022/08/26