[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 0cea7e107a 21/76: Simplify implementation of sty
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 0cea7e107a 21/76: Simplify implementation of style/cleveref.el |
Date: |
Fri, 13 Jan 2023 14:30:55 -0500 (EST) |
branch: externals/auctex
commit 0cea7e107a2ec612bea1add75f731c29dda55951
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>
Simplify implementation of style/cleveref.el
* style/cleveref.el (TeX-arg-cleveref-crossref-type): Delete
function.
(LaTeX-cleveref-crossref-type): New function.
("cleveref"): Adjust the hook acc. to the changes above.
---
style/cleveref.el | 70 ++++++++++++++++++++++++++++++++++---------------------
1 file changed, 44 insertions(+), 26 deletions(-)
diff --git a/style/cleveref.el b/style/cleveref.el
index 373dcd85a6..9d91c26217 100644
--- a/style/cleveref.el
+++ b/style/cleveref.el
@@ -1,6 +1,6 @@
;;; cleveref.el --- AUCTeX style for `cleveref.sty' (v0.21.4) -*-
lexical-binding: t; -*-
-;; Copyright (C) 2014--2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014--2022 Free Software Foundation, Inc.
;; Author: Matthew Leach <matthew@mattleach.net>
;; Maintainer: auctex-devel@gnu.org
@@ -55,18 +55,12 @@ string."
(labels-string (mapconcat #'identity labels ",")))
(TeX-argument-insert labels-string optional))))
-(defun TeX-arg-cleveref-crossref-type (optional &optional prompt)
- "Insert the cross-reference type for macros of cleveref package.
-If OPTIONAL is non-nil, insert the resulting value in brackets.
-Use PROMPT as the prompt string."
- (let* ((type (mapcar #'list
- '("appendix" "subappendix" "subsubappendix"
- "subsubsubappendix" "subfigure" "subtable"
- "subequation")))
- (types (append (LaTeX-counter-list) type)))
- (TeX-argument-insert
- (completing-read (TeX-argument-prompt optional prompt "Type") types)
- optional)))
+(defun LaTeX-cleveref-crossref-type ()
+ "Return a list of cross-reference types for cleveref package macros."
+ (let ((type (mapcar #'list '("appendix" "subappendix"
+ "subsubappendix" "subsubsubappendix"
+ "subfigure" "subtable" "subequation"))))
+ (append (LaTeX-counter-list) type)))
(defvar LaTeX-cleveref-label-regexp
'("\\\\label\\[[^]]*\\]{\\([^\n\r%\\{}]+\\)}" 1 LaTeX-auto-label)
@@ -100,32 +94,56 @@ Use PROMPT as the prompt string."
'("labelcpageref" TeX-arg-cleveref-multiple-labels)
;; 6 Overriding the Cross-Reference Type
'("crefalias" TeX-arg-counter "Type")
- '("label" [ TeX-arg-cleveref-crossref-type ] TeX-arg-define-label)
+ '("label"
+ [TeX-arg-completing-read (LaTeX-cleveref-crossref-type) "Type"]
+ TeX-arg-define-label)
;; 8.1.1 Global Customisation
'("crefdefaultlabelformat" t)
;; 8.1.2 Customising Individual Cross-Reference Types
- '("crefname" TeX-arg-cleveref-crossref-type
+ '("crefname"
+ (TeX-arg-completing-read (LaTeX-cleveref-crossref-type) "Type")
"Singular name" "Plural name")
- '("Crefname" TeX-arg-cleveref-crossref-type
+ '("Crefname"
+ (TeX-arg-completing-read (LaTeX-cleveref-crossref-type) "Type")
"Singular name" "Plural name")
- '("creflabelformat" TeX-arg-cleveref-crossref-type t)
- '("crefrangelabelformat" TeX-arg-cleveref-crossref-type t)
+ '("creflabelformat"
+ (TeX-arg-completing-read (LaTeX-cleveref-crossref-type) "Type")
+ t)
+ '("crefrangelabelformat"
+ (TeX-arg-completing-read (LaTeX-cleveref-crossref-type) "Type")
+ t)
;; 8.2.1 Single Cross-References
- '("crefformat" TeX-arg-cleveref-crossref-type t)
- '("Crefformat" TeX-arg-cleveref-crossref-type t)
+ '("crefformat"
+ (TeX-arg-completing-read (LaTeX-cleveref-crossref-type) "Type")
+ t)
+ '("Crefformat"
+ (TeX-arg-completing-read (LaTeX-cleveref-crossref-type) "Type")
+ t)
;; 8.2.2 Reference Ranges
- '("crefrangeformat" TeX-arg-cleveref-crossref-type t)
- '("Crefrangeformat" TeX-arg-cleveref-crossref-type t)
+ '("crefrangeformat"
+ (TeX-arg-completing-read (LaTeX-cleveref-crossref-type) "Type")
+ t)
+ '("Crefrangeformat"
+ (TeX-arg-completing-read (LaTeX-cleveref-crossref-type) "Type")
+ t)
;; 8.2.3 Multiple Cross-References
- '("crefmultiformat" TeX-arg-cleveref-crossref-type 4)
- '("Crefmultiformat" TeX-arg-cleveref-crossref-type 4)
- '("crefrangemultiformat" TeX-arg-cleveref-crossref-type 4)
- '("Crefrangemultiformat" TeX-arg-cleveref-crossref-type 4))
+ '("crefmultiformat"
+ (TeX-arg-completing-read (LaTeX-cleveref-crossref-type) "Type")
+ 4)
+ '("Crefmultiformat"
+ (TeX-arg-completing-read (LaTeX-cleveref-crossref-type) "Type")
+ 4)
+ '("crefrangemultiformat"
+ (TeX-arg-completing-read (LaTeX-cleveref-crossref-type) "Type")
+ 4)
+ '("Crefrangemultiformat"
+ (TeX-arg-completing-read (LaTeX-cleveref-crossref-type) "Type")
+ 4))
;; These macros aren't used particularly often during the course of
;; normal referencing.
- [elpa] externals/auctex d7dc696f47 25/76: * latex.el (LaTeX-env-contents): Add the "nowarn" key., (continued)
- [elpa] externals/auctex d7dc696f47 25/76: * latex.el (LaTeX-env-contents): Add the "nowarn" key., Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 7c15b32d06 47/76: Simplify implementation of style/ltugboat.el, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 3e8aa71ef2 35/76: Fix bug#58689 with a bit of optiomization, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 68e14e7ce4 45/76: * style/ltablex.el ("ltablex"): Add fontification support., Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 5b73efbfe3 51/76: ; * latex.el (LaTeX-what-macro): Assign values in one go., Tassilo Horn, 2023/01/13
- [elpa] externals/auctex d3ab64f893 60/76: Reduce redundancy in regexp, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex b2b899a450 66/76: ; * style/pstricks.el (LaTeX-package-parameter-value): Pacify compiler., Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 22fa670915 55/76: ; Fix doc strings, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex f9b378a45c 70/76: Support detached arguments, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 8984821716 74/76: ; * style/natbib.el ("natbib"): Fontify \citetext., Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 0cea7e107a 21/76: Simplify implementation of style/cleveref.el,
Tassilo Horn <=
- [elpa] externals/auctex ba70baec6c 27/76: Fix doc strings regarding to section commands, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex a648993763 22/76: * style/comment.el ("comment"): Replace `TeX-arg-eval'., Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 13c77f998e 28/76: Simplify implementation of style/empheq.el, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 5b693f4e2e 42/76: ; * style/hyperref.el ("hyperref"): Don't use list inside vector., Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 324cb5c913 41/76: Simplify implementation of style/hologo.el, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 8941bd640f 33/76: * style/fontspec.el ("fontspec"): Replace `TeX-arg-eval'., Tassilo Horn, 2023/01/13
- [elpa] externals/auctex a57e627284 59/76: Improve consistency between similar functions, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 906e57dfb8 68/76: ; * style/physics.el: Write proper date., Tassilo Horn, 2023/01/13
- [elpa] externals/auctex ff65b9b4d0 65/76: Avoid compiler warnings with long function names, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 4700af5dd4 64/76: ; Delete ineffective string escapes reported by Relint, Tassilo Horn, 2023/01/13