[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 ac7ad4fff4 36/76: Simplify implementation of style/footmisc.el, (continued)
- [elpa] externals/auctex ac7ad4fff4 36/76: Simplify implementation of style/footmisc.el, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex d7dc696f47 25/76: * latex.el (LaTeX-env-contents): Add the "nowarn" key., Tassilo Horn, 2023/01/13
- [elpa] externals/auctex c7de94dc94 24/76: Replace `TeX-arg-eval', Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 33bb54bb9e 38/76: Simplify implementation of style/geometry.el, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 5c67eb2dfd 07/76: Simplify implementation of style/babel.el, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex e97fb94f4e 62/76: Pacify compiler warning, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 22336f15bd 52/76: Simplify implementation of style/mathtools.el, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex bf66b302a4 61/76: Improve the previous commit slightly, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 5484b57bc4 31/76: Don't rely on the value of `LaTeX-current-environment', Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 1def8bd570 39/76: ; * style/graphics.el ("graphics"): Remove unnecessary `function'., Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 0cea7e107a 21/76: Simplify implementation of style/cleveref.el,
Tassilo Horn <=
- [elpa] externals/auctex 6bdb392dfe 01/76: ; * style/theorem.el ("theorem"): Fix last change., Tassilo Horn, 2023/01/13
- [elpa] externals/auctex eb7b8d4de4 44/76: * style/listings.el ("listings"): Replace `TeX-arg-eval'., Tassilo Horn, 2023/01/13
- [elpa] externals/auctex ba70baec6c 27/76: Fix doc strings regarding to section commands, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 83622003aa 46/76: * style/enumitem.el ("enumitem"): Replace `TeX-arg-eval'., Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 7f9e7ec8a1 05/76: * style/array.el ("array"): Replace `TeX-arg-eval' with a closure., 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 54c82bd093 67/76: New style file physics.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 30bca31f77 71/76: ; * style/xcolor.el ("xcolor"): 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