auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] [elpa] externals/auctex 724da15 17/23: Update style/thmto


From: Tassilo Horn
Subject: [AUCTeX-diffs] [elpa] externals/auctex 724da15 17/23: Update style/thmtools.el to package version 0.72
Date: Sat, 23 Jan 2021 04:10:09 -0500 (EST)

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

    Update style/thmtools.el to package version 0.72
    
    * style/thmtools.el (LaTeX-arg-thmtools-declaretheorem): Query for
    the optional argument after the mandatory environment name.
    (LaTeX-thmtools-env-label): Use `read-char-choice' instead of
    `read-char'.
    Set `help-form' in the let-binding.
    (LaTeX-thmtools-listoftheorems-key-val): Update key=val's.
    ("thmtools"): Fontify also the optional argument after the
    mandatory one.  Keep the old behavior for compatibility.
---
 style/thmtools.el | 38 +++++++++++++++++++++++---------------
 1 file changed, 23 insertions(+), 15 deletions(-)

diff --git a/style/thmtools.el b/style/thmtools.el
index a4a33b4..f4be618 100644
--- a/style/thmtools.el
+++ b/style/thmtools.el
@@ -1,6 +1,6 @@
-;;; thmtools.el --- AUCTeX style for `thmtools.sty' (v67)  -*- 
lexical-binding: t; -*-
+;;; thmtools.el --- AUCTeX style for `thmtools.sty' (v0.72)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2018--2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018--2021 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -26,7 +26,7 @@
 
 ;;; Commentary:
 
-;; This file adds support for `thmtools.sty' (v67) from 2019/07/31.
+;; This file adds support for `thmtools.sty' (v0.72) from 2020/08/01.
 ;; `thmtools.sty' is part of TeXLive.
 
 ;;; Code:
@@ -169,15 +169,15 @@ minibuffer.  PROMPT replaces the standard one."
 If OPTIONAL is non-nil, also insert the second argument in square
 brackets.  PROMPT replaces the standard one for the second
 argument."
+  (let ((env (TeX-read-string
+              (TeX-argument-prompt optional prompt "Environment"))))
+    (LaTeX-add-environments `(,env LaTeX-thmtools-env-label))
+    (TeX-argument-insert env optional))
   (let ((TeX-arg-opening-brace "[")
         (TeX-arg-closing-brace "]"))
     (TeX-argument-insert
      (LaTeX-thmtools-declaretheorem-key-val t)
-     t))
-  (let ((env (TeX-read-string
-              (TeX-argument-prompt optional prompt "Environment"))))
-    (LaTeX-add-environments `(,env LaTeX-thmtools-env-label))
-    (TeX-argument-insert env optional)))
+     t)))
 
 (defun LaTeX-thmtools-listoftheorems-key-val (optional &optional prompt)
   "Query and return a key=val string for \\listoftheorems macro.
@@ -199,13 +199,14 @@ minibuffer.  PROMPT replaces the standard one."
                (mapcar #'car (LaTeX-thmtools-declaretheorem-list)))))
     (TeX-read-key-val
      optional
-     `(("numwidth" ,lengths)
+     `(("title")
        ("ignore" ,thms)
-       ("onlynamed" ,thms)
-       ("show" ,thms)
        ("ignoreall" ("true" "false"))
+       ("show" ,thms)
        ("showall" ("true" "false"))
-       ("title"))
+       ("onlynamed" ,thms)
+       ("swapnumber" ("true" "false"))
+       ("numwidth" ,lengths))
      prompt)))
 
 (defun LaTeX-arg-thmtools-listoftheorems (optional &optional prompt)
@@ -230,8 +231,15 @@ RefTeX users should customize or add ENVIRONMENT to
   (add-to-list \\='reftex-label-alist
                \\='(\"theorem\" ?m \"thm:\" \"~\\ref{%s}\"
                  nil (\"Theorem\" \"theorem\") nil))"
-  (let* ((choice (read-char
-                  (TeX-argument-prompt nil nil "Heading (h), Key=val (k), 
Empty (RET)")))
+  (let* ((help-form "\
+Select the content of the optional argument with a key:
+`h' in order to insert a plain heading,
+`k' in order to insert key=value pairs with completion,
+RET in order to leave it empty.")
+         (choice (read-char-choice
+                  (TeX-argument-prompt
+                   nil nil "Heading (h), Key=val (k), Empty (RET)")
+                  '(?h ?k)))
          (opthead (cond ((= choice ?h)
                          (TeX-read-string
                           (TeX-argument-prompt t nil "Heading")))
@@ -291,7 +299,7 @@ RefTeX users should customize or add ENVIRONMENT to
    (when (and (featurep 'font-latex)
               (eq TeX-install-font-lock 'font-latex-setup))
      (font-latex-add-keywords '(("declaretheoremstyle"  "[{")
-                                ("declaretheorem"       "[{")
+                                ("declaretheorem"       "[{[")
                                 ("listoftheorems"       "[")
                                 ("ignoretheorems"       "{"))
                               'function)))




reply via email to

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