[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 78bc8d6b56 36/39: * style/menukeys.el ("menukeys
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 78bc8d6b56 36/39: * style/menukeys.el ("menukeys"): Replace `TeX-arg-eval'. |
Date: |
Thu, 20 Jul 2023 04:21:51 -0400 (EDT) |
branch: externals/auctex
commit 78bc8d6b5602570a02093fd5ce449a269633f158
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>
* style/menukeys.el ("menukeys"): Replace `TeX-arg-eval'.
---
style/menukeys.el | 270 ++++++++++++++++++++++++------------------------------
1 file changed, 121 insertions(+), 149 deletions(-)
diff --git a/style/menukeys.el b/style/menukeys.el
index 72b5560deb..62c905d8b8 100644
--- a/style/menukeys.el
+++ b/style/menukeys.el
@@ -1,6 +1,6 @@
;;; menukeys.el --- AUCTeX style for `menukeys.sty' (v1.4) -*-
lexical-binding: t; -*-
-;; Copyright (C) 2016--2022 Free Software Foundation, Inc.
+;; Copyright (C) 2016--2023 Free Software Foundation, Inc.
;; Author: Arash Esbati <arash@gnu.org>
;; Maintainer: auctex-devel@gnu.org
@@ -220,62 +220,57 @@ macro. If RENEW is non-nil, query for an already defined
macro."
;; 4.2.2 Declaring styles
;; \newmenustylesimple*{<name>}[<pre>]{<style>}[<sep>][<post>]{<theme>}
- '("newmenustylesimple"
- (TeX-arg-eval
- (lambda ()
+ `("newmenustylesimple"
+ ,(lambda (optional)
(let ((name (TeX-read-string
- (TeX-argument-prompt nil nil "Name"))))
+ (TeX-argument-prompt optional nil "Name"))))
(LaTeX-add-menukeys-newmenustyles name)
- (format "%s" name))))
+ (TeX-argument-insert name optional)))
[ t ] nil [ nil ] [ nil ]
(TeX-arg-completing-read (LaTeX-menukeys-newmenucolortheme-list)
"Color theme"))
- '("newmenustylesimple*"
- (TeX-arg-eval
- (lambda ()
+ `("newmenustylesimple*"
+ ,(lambda (optional)
(let ((name (TeX-read-string
- (TeX-argument-prompt nil nil "Name"))))
+ (TeX-argument-prompt optional nil "Name"))))
(LaTeX-add-menukeys-newmenustyles name)
- (format "%s" name))))
+ (TeX-argument-insert name optional)))
[ t ] nil [ nil ] [ nil ]
- (TeX-arg-completing-read (LaTeX-menukeys-newmenucolortheme-list) "Color
theme"))
+ (TeX-arg-completing-read (LaTeX-menukeys-newmenucolortheme-list)
+ "Color theme"))
;;
\newmenustyle*{<name>}[<pre>]{<first>}[<sep>]{<mid>}{<last>}{<single>}[<post>]{<theme>}
- '("newmenustyle"
- (TeX-arg-eval
- (lambda ()
+ `("newmenustyle"
+ ,(lambda (optional)
(let ((name (TeX-read-string
- (TeX-argument-prompt nil nil "Name"))))
+ (TeX-argument-prompt optional nil "Name"))))
(LaTeX-add-menukeys-newmenustyles name)
- (format "%s" name))))
+ (TeX-argument-insert name optional)))
[ t ] nil [ nil ] nil nil nil [ nil ]
- (TeX-arg-completing-read (LaTeX-menukeys-newmenucolortheme-list) "Color
theme"))
+ (TeX-arg-completing-read (LaTeX-menukeys-newmenucolortheme-list)
+ "Color theme"))
- '("newmenustyle*"
- (TeX-arg-eval
- (lambda ()
+ `("newmenustyle*"
+ ,(lambda (optional)
(let ((name (TeX-read-string
- (TeX-argument-prompt nil nil "Name"))))
+ (TeX-argument-prompt optional nil "Name"))))
(LaTeX-add-menukeys-newmenustyles name)
- (format "%s" name))))
+ (TeX-argument-insert name optional)))
[ t ] nil [ nil ] nil nil nil [ nil ]
- (TeX-arg-completing-read (LaTeX-menukeys-newmenucolortheme-list) "Color
theme"))
+ (TeX-arg-completing-read (LaTeX-menukeys-newmenucolortheme-list)
+ "Color theme"))
'("CurrentMenuElement" 0)
;; 4.2.3 Copying styles
- '("copymenustyle"
- (TeX-arg-eval
- (lambda ()
+ `("copymenustyle"
+ ,(lambda (optional)
(let ((copy (TeX-read-string
- (TeX-argument-prompt nil nil "Copy")))
- (orig (completing-read
- (TeX-argument-prompt nil nil "Original")
- (LaTeX-menukeys-newmenustyle-list))))
+ (TeX-argument-prompt optional nil "Copy"))))
(LaTeX-add-menukeys-newmenustyles copy)
- (TeX-argument-insert copy nil)
- (format "%s" orig)))))
+ (TeX-argument-insert copy optional)))
+ (TeX-arg-completing-read (LaTeX-menukeys-newmenustyle-list) "Original"))
;; 4.2.4 Changing styles
;; \changemenuelement*{name}{element}{definition}
@@ -294,13 +289,12 @@ macro. If RENEW is non-nil, query for an already defined
macro."
(TeX-arg-completing-read (LaTeX-menukeys-newmenucolortheme-list)
"Color theme"))
- '("providemenustylesimple"
- (TeX-arg-eval
- (lambda ()
+ `("providemenustylesimple"
+ ,(lambda (optional)
(let ((name (TeX-read-string
- (TeX-argument-prompt nil nil "Name"))))
+ (TeX-argument-prompt optional nil "Name"))))
(LaTeX-add-menukeys-newmenustyles name)
- (format "%s" name))))
+ (TeX-argument-insert name optional)))
[ t ] nil [ nil ] [ nil ]
(TeX-arg-completing-read (LaTeX-menukeys-newmenucolortheme-list)
"Color theme"))
@@ -312,13 +306,12 @@ macro. If RENEW is non-nil, query for an already defined
macro."
(TeX-arg-completing-read (LaTeX-menukeys-newmenucolortheme-list)
"Color theme"))
- '("renewmenustyle"
- (TeX-arg-eval
- (lambda ()
+ `("renewmenustyle"
+ ,(lambda (optional)
(let ((name (TeX-read-string
- (TeX-argument-prompt nil nil "Name"))))
+ (TeX-argument-prompt optional nil "Name"))))
(LaTeX-add-menukeys-newmenustyles name)
- (format "%s" name))))
+ (TeX-argument-insert name optional)))
[ t ] nil [ nil ] nil nil nil [ nil ]
(TeX-arg-completing-read (LaTeX-menukeys-newmenucolortheme-list)
"Color theme"))
@@ -326,116 +319,96 @@ macro. If RENEW is non-nil, query for an already
defined macro."
;; 4.3 Color themes
;; 4.3.2 Create a theme
;; \newmenucolortheme{<name>}{<model>}{<bg>}{<br>}{<txt>}[<a>][<b>][<c>]
- '("newmenucolortheme"
- (TeX-arg-eval
- (lambda ()
+ `("newmenucolortheme"
+ ,(lambda (optional)
(let ((name (TeX-read-string
- (TeX-argument-prompt nil nil "Name"))))
+ (TeX-argument-prompt optional nil "Name"))))
(LaTeX-add-menukeys-newmenucolorthemes name)
- (format "%s" name))))
- (TeX-arg-eval
- (lambda ()
- (let ((model (completing-read
- (TeX-argument-prompt nil nil "Model")
- (LaTeX-xcolor-color-models))))
- (TeX-argument-insert model nil)
- (if (string= model "named")
- (let ((bg (completing-read
- (TeX-argument-prompt nil nil "Node background color")
- (LaTeX-xcolor-definecolor-list)))
- (br (completing-read
- (TeX-argument-prompt nil nil "Node border color")
- (LaTeX-xcolor-definecolor-list)))
- (txt (completing-read
- (TeX-argument-prompt nil nil "Node text color")
- (LaTeX-xcolor-definecolor-list))))
- (TeX-argument-insert bg nil)
- (TeX-argument-insert br nil)
- (format "%s" txt))
- (let ((bg (TeX-read-string
- (TeX-argument-prompt nil nil "Node background color
spec")))
- (br (TeX-read-string
- (TeX-argument-prompt nil nil "Node border color
spec")))
- (txt (TeX-read-string
- (TeX-argument-prompt nil nil "Node text color
spec"))))
- (TeX-argument-insert bg nil)
- (TeX-argument-insert br nil)
- (format "%s" txt))))))
+ (TeX-argument-insert name optional)))
+ (TeX-arg-completing-read (LaTeX-xcolor-color-models) "Model")
+ (TeX-arg-conditional (save-excursion
+ (re-search-backward
+ "\\\\newmenucolortheme{[^}]+}{\\([^}]+\\)}"
+ (line-beginning-position) t)
+ (string= (match-string-no-properties 1) "named"))
+ ((TeX-arg-completing-read (LaTeX-xcolor-definecolor-list)
+ "Node background color"))
+ ("Node background color spec"))
+ (TeX-arg-conditional (save-excursion
+ (re-search-backward
+ "\\\\newmenucolortheme{[^}]+}{\\([^}]+\\)}"
+ (line-beginning-position) t)
+ (string= (match-string-no-properties 1) "named"))
+ ((TeX-arg-completing-read (LaTeX-xcolor-definecolor-list)
+ "Node border color"))
+ ("Node border color spec"))
+ (TeX-arg-conditional (save-excursion
+ (re-search-backward
+ "\\\\newmenucolortheme{[^}]+}{\\([^}]+\\)}"
+ (line-beginning-position) t)
+ (string= (match-string-no-properties 1) "named"))
+ ((TeX-arg-completing-read (LaTeX-xcolor-definecolor-list)
+ "Node text color"))
+ ("Node text color spec"))
(TeX-arg-conditional (y-or-n-p "With additional optional arguments? ")
- ( [ 3 ] )
- (ignore)))
+ ( [ 3 ] )
+ (ignore)))
;; 4.3.3 Copy a theme
- '("copymenucolortheme"
- (TeX-arg-eval
- (lambda ()
+ `("copymenucolortheme"
+ ,(lambda (optional)
(let ((copy (TeX-read-string
- (TeX-argument-prompt nil nil "Copy")))
- (orig (completing-read
- (TeX-argument-prompt nil nil "Original")
- (LaTeX-menukeys-newmenucolortheme-list))))
+ (TeX-argument-prompt optional nil "Copy"))))
(LaTeX-add-menukeys-newmenucolorthemes copy)
- (TeX-argument-insert copy nil)
- (format "%s" orig)))))
+ (TeX-argument-insert copy optional)))
+ (TeX-arg-completing-read (LaTeX-menukeys-newmenucolortheme-list)
+ "Original"))
;; 4.3.4 Change a theme
'("changemenucolor"
(TeX-arg-completing-read (LaTeX-menukeys-newmenucolortheme-list) "Name")
(TeX-arg-completing-read ("bg" "br" "txt") "Element")
- (TeX-arg-eval
- (lambda ()
- (let ((model (completing-read
- (TeX-argument-prompt nil nil "Model")
- (LaTeX-xcolor-color-models))))
- (TeX-argument-insert model nil)
- (if (string= model "named")
- (let ((color (completing-read
- (TeX-argument-prompt nil nil "Color")
- (LaTeX-xcolor-definecolor-list))))
- (format "%s" color))
- (let ((color (TeX-read-string
- (TeX-argument-prompt nil nil "Color spec"))))
- (format "%s" color)))))))
+ (TeX-arg-completing-read (LaTeX-xcolor-color-models) "Model")
+ (TeX-arg-conditional (save-excursion
+ (re-search-backward
+ "\\\\changemenucolor{[^}]+}{[^}]+}{\\([^}]+\\)}"
+ (line-beginning-position) t)
+ (string= (match-string-no-properties 1) "named"))
+ ((TeX-arg-completing-read (LaTeX-xcolor-definecolor-list) "Color"))
+ ("Color spec")))
;; Same arguments as \newmenucolortheme
'("renewmenucolortheme"
- (TeX-arg-eval
- (lambda ()
- (let ((name (TeX-read-string
- (TeX-argument-prompt nil nil "Name"))))
- (LaTeX-add-menukeys-newmenucolorthemes name)
- (format "%s" name))))
- (TeX-arg-eval
- (lambda ()
- (let ((model (completing-read
- (TeX-argument-prompt nil nil "Model")
- (LaTeX-xcolor-color-models))))
- (TeX-argument-insert model nil)
- (if (string= model "named")
- (let ((bg (completing-read
- (TeX-argument-prompt nil nil "Node background color")
- (LaTeX-xcolor-definecolor-list)))
- (br (completing-read
- (TeX-argument-prompt nil nil "Node border color")
- (LaTeX-xcolor-definecolor-list)))
- (txt (completing-read
- (TeX-argument-prompt nil nil "Node text color")
- (LaTeX-xcolor-definecolor-list))))
- (TeX-argument-insert bg nil)
- (TeX-argument-insert br nil)
- (format "%s" txt))
- (let ((bg (TeX-read-string
- (TeX-argument-prompt nil nil "Node background color
spec")))
- (br (TeX-read-string
- (TeX-argument-prompt nil nil "Node border color
spec")))
- (txt (TeX-read-string
- (TeX-argument-prompt nil nil "Node text color
spec"))))
- (TeX-argument-insert bg nil)
- (TeX-argument-insert br nil)
- (format "%s" txt))))))
+ (TeX-arg-completing-read (LaTeX-menukeys-newmenucolortheme-list)
+ "Name")
+ (TeX-arg-completing-read (LaTeX-xcolor-color-models) "Model")
+ (TeX-arg-conditional (save-excursion
+ (re-search-backward
+ "\\\\renewmenucolortheme{[^}]+}{\\([^}]+\\)}"
+ (line-beginning-position) t)
+ (string= (match-string-no-properties 1) "named"))
+ ((TeX-arg-completing-read (LaTeX-xcolor-definecolor-list)
+ "Node background color"))
+ ("Node background color spec"))
+ (TeX-arg-conditional (save-excursion
+ (re-search-backward
+ "\\\\renewmenucolortheme{[^}]+}{\\([^}]+\\)}"
+ (line-beginning-position) t)
+ (string= (match-string-no-properties 1) "named"))
+ ((TeX-arg-completing-read (LaTeX-xcolor-definecolor-list)
+ "Node border color"))
+ ("Node border color spec"))
+ (TeX-arg-conditional (save-excursion
+ (re-search-backward
+ "\\\\renewmenucolortheme{[^}]+}{\\([^}]+\\)}"
+ (line-beginning-position) t)
+ (string= (match-string-no-properties 1) "named"))
+ ((TeX-arg-completing-read (LaTeX-xcolor-definecolor-list)
+ "Node text color"))
+ ("Node text color spec"))
(TeX-arg-conditional (y-or-n-p "With additional optional arguments? ")
- ( [ 3 ] )
- (ignore)))
+ ( [ 3 ] )
+ (ignore)))
;; 4.4 Menu macros
;; 4.4.2 Defining or changing menu macros
@@ -463,18 +436,17 @@ macro. If RENEW is non-nil, query for an already defined
macro."
(os '("mac" "win"))
collector)
(dolist (cmd keycmds)
- (cond
- ((= (cdr cmd) 0)
- (push (car cmd) collector))
- ((= (cdr cmd) 1)
- (push (list (car cmd) '(TeX-arg-completing-read
- ("^" "v" ">" "<")
- "Direction"))
- collector))
- ((= (cdr cmd) 2)
- (push (car cmd) collector)
- (dolist (x os)
- (push (concat (car cmd) x) collector)))))
+ (cond ((= (cdr cmd) 0)
+ (push (car cmd) collector))
+ ((= (cdr cmd) 1)
+ (push (list (car cmd)
+ '(TeX-arg-completing-read ("^" "v" ">" "<")
+ "Direction"))
+ collector))
+ ((= (cdr cmd) 2)
+ (push (car cmd) collector)
+ (dolist (x os)
+ (push (concat (car cmd) x) collector)))))
(apply #'TeX-add-symbols collector)))
;; Fontification:
- [elpa] externals/auctex 2017d97b0e 09/39: Rewrite *-unload-hook to *-unload-function, (continued)
- [elpa] externals/auctex 2017d97b0e 09/39: Rewrite *-unload-hook to *-unload-function, Tassilo Horn, 2023/07/20
- [elpa] externals/auctex c67f5d75b2 14/39: ; * Makefile.in (STYLESRC): Fix last change., Tassilo Horn, 2023/07/20
- [elpa] externals/auctex 1c3360b162 39/39: Release GNU AUCTeX 13.2.1, Tassilo Horn, 2023/07/20
- [elpa] externals/auctex cdd0cbf33a 03/39: Add new style/soul.el, Tassilo Horn, 2023/07/20
- [elpa] externals/auctex 6d34e1f1ae 34/39: Simplify implementation of style/paralist.el, Tassilo Horn, 2023/07/20
- [elpa] externals/auctex fe42de7cf6 26/39: Obey buffer-local value of TeX-error-overview-open-after-TeX-run, Tassilo Horn, 2023/07/20
- [elpa] externals/auctex 38e729a75f 28/39: * latex.el (LaTeX-common-initialization): Replace `TeX-arg-eval'., Tassilo Horn, 2023/07/20
- [elpa] externals/auctex da28858e46 20/39: Improve handling of beamer class options, Tassilo Horn, 2023/07/20
- [elpa] externals/auctex 7a347cd394 10/39: Remove compatibility code for Emacs<26, Tassilo Horn, 2023/07/20
- [elpa] externals/auctex 2969b24b52 16/39: ; * style/wasysym.el: Silence warnings from 'make dynvars-check'., Tassilo Horn, 2023/07/20
- [elpa] externals/auctex 78bc8d6b56 36/39: * style/menukeys.el ("menukeys"): Replace `TeX-arg-eval'.,
Tassilo Horn <=
- [elpa] externals/auctex 93fa8bde57 17/39: Introduce new fontification keywords class "function-noarg", Tassilo Horn, 2023/07/20
- [elpa] externals/auctex 28aa6b99e4 18/39: Harmonize provisioning of package options, Tassilo Horn, 2023/07/20
- [elpa] externals/auctex befc4a49bb 07/39: Fix style/changelog.el, Tassilo Horn, 2023/07/20
- [elpa] externals/auctex 6439edca63 12/39: Clean up Texinfo mode, Tassilo Horn, 2023/07/20
- [elpa] externals/auctex 7e420cff9b 08/39: ; * style/soul.el ("soul"): Use `LaTeX-soul-auto-cleanup'., Tassilo Horn, 2023/07/20
- [elpa] externals/auctex 5bfc2cb68a 11/39: Clean up ConTeXt mode, Tassilo Horn, 2023/07/20
- [elpa] externals/auctex 3b38bd625b 04/39: Fontify \sloppy and \fussy, Tassilo Horn, 2023/07/20
- [elpa] externals/auctex e8b451297a 33/39: Improve query of optional notes for natbib cite macros, Tassilo Horn, 2023/07/20
- [elpa] externals/auctex 658340b188 32/39: Remove requiring a match during `completing-read', Tassilo Horn, 2023/07/20
- [elpa] externals/auctex 715a88a5f2 22/39: Treat backslash in verbatim macro arguments correctly, Tassilo Horn, 2023/07/20