emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/auctex 0152938 22/26: Update style/ulem.el


From: Tassilo Horn
Subject: [elpa] externals/auctex 0152938 22/26: Update style/ulem.el
Date: Thu, 12 Aug 2021 11:18:24 -0400 (EDT)

branch: externals/auctex
commit 01529388942f0ae37abe0908c1c048ae8a32b220
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>

    Update style/ulem.el
    
    * style/ulem.el ("ulem"): Add macros \dashuline and \dotuline.
    Fix \markoverwith which takes one argument.
    Add \ULdepth to list of known lengths.
    Cater fontification for added macros.
    (LaTeX-ulem-fontdecl, LaTeX-ulem-fontcmd): Rename from
    `LaTeX-arg-fontdecl' and `LaTeX-arg-fontcmd'.
    (TeX-arg-ulem-fontdecl, TeX-arg-ulem-fontcmd): Use renamed
    variables.
    (TeX-arg-ulem-useunder): Don't listify the completion candidates,
    `completing-read' can handle list of strings.
---
 style/ulem.el | 50 +++++++++++++++++++++++++++++++-------------------
 1 file changed, 31 insertions(+), 19 deletions(-)

diff --git a/style/ulem.el b/style/ulem.el
index 70ea7a8..f84fcc6 100644
--- a/style/ulem.el
+++ b/style/ulem.el
@@ -24,7 +24,7 @@
 
 ;;; Commentary:
 
-;; This file adds support for `ulem.sty'.
+;; This file adds support for `ulem.sty' dated 2019-11-18.
 
 ;;; Code:
 
@@ -44,38 +44,48 @@
     '("uwave" 1)
     '("sout" 1)
     '("xout" 1)
-    ;; can be used with \renewcommand or \setlength
+    '("dashuline" 1)
+    '("dotuline" 1)
+    ;; can be used with \renewcommand
     "ULthickness"
-    "ULdepth"
     ;; custom commands can be defined with these commands; see the
     ;; documentation for an example
     "ULon"
-    "markoverwith"
+    ;; \markoverwith takes on argument
+    '("markoverwith" 1)
     ;; \useunder {underline_command}{font_declaration}{font_command}
     ;; replaces occurences of font_declaration and font_command with the
     ;; underline_command
     '("useunder" TeX-arg-ulem-useunder
       TeX-arg-ulem-fontdecl TeX-arg-ulem-fontcmd))
 
+   ;; \ULdepth can be changed with \setlength
+   (LaTeX-add-lengths "ULdepth")
+
    ;; Fontification
    (when (and (featurep 'font-latex)
               (eq TeX-install-font-lock 'font-latex-setup))
      ;; Tell font-lock about the update.
-     (font-latex-add-keywords '(("useunder" "{{{")) 'function)
+     (font-latex-add-keywords '(("useunder" "{{{"))
+                              'function)
      (font-latex-add-keywords '(("uline" "{")
+                                ("uuline" "{")
                                 ("uwave" "{")
                                 ("sout" "{")
-                                ("xout" "{")) 'textual)))
+                                ("xout" "{")
+                                ("dashuline" "{")
+                                ("dotuline" "{"))
+                              'textual)))
  TeX-dialect)
 
-(defvar LaTeX-arg-fontdecl
+(defvar LaTeX-ulem-fontdecl
   (mapcar (lambda (str) (concat "\\" str))
           '("itshape" "bfseries" "scshape"
             "ttfamily" "upshape" "mdseries"
             "rmfamily" "sffamily" "slshape"))
-  "List of font declaration commands in LaTeX")
+  "List of font declaration commands in LaTeX.")
 
-(defvar LaTeX-arg-fontcmd
+(defvar LaTeX-ulem-fontcmd
   (mapcar (lambda (str) (concat "\\" str))
           '("textit" "textbf" "textsc"
             "texttt" "textup" "textmd"
@@ -83,28 +93,30 @@
   "List of font commands in LaTeX")
 
 (defun TeX-arg-ulem-fontdecl (optional &optional prompt)
-  "Prompt for the font-declaration un \\useunder"
+  "Prompt for the font-declaration un \\useunder."
   (TeX-argument-insert
    (completing-read (TeX-argument-prompt
                      optional prompt "Font declaration")
-                    LaTeX-arg-fontdecl nil t) optional))
+                    LaTeX-ulem-fontdecl nil t)
+   optional))
 
 (defun TeX-arg-ulem-fontcmd (optional &optional prompt)
-  "Prompt for the font-declaration un \\useunder"
+  "Prompt for the font-declaration un \\useunder."
   (TeX-argument-insert
    (completing-read (TeX-argument-prompt
                      optional prompt "Font command")
-                    LaTeX-arg-fontcmd nil t) optional))
+                    LaTeX-ulem-fontcmd nil t)
+   optional))
 
-;; adapted from url.el:TeX-arg-urlstyle
+;; adapted from url.el: TeX-arg-urlstyle
 (defun TeX-arg-ulem-useunder (optional &optional prompt)
-  "Prompt for underline command used in \\useunder"
+  "Prompt for underline command used in \\useunder."
   (TeX-argument-insert
    (completing-read (TeX-argument-prompt optional prompt "Underline command")
-                    (mapcar #'list
-                            (mapcar (lambda (str) (concat "\\" str))
-                                    '("uline" "uuline"
-                                      "uwave" "sout" "xout")))
+                    (mapcar (lambda (str) (concat "\\" str))
+                            '("uline" "uuline"
+                              "uwave" "sout" "xout"
+                              "dashuline" "dotuline"))
                     nil t)
    optional))
 



reply via email to

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