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

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

[elpa] externals/auctex 11e9dbfdf3 30/39: Track last change for \newtheo


From: Tassilo Horn
Subject: [elpa] externals/auctex 11e9dbfdf3 30/39: Track last change for \newtheorem macro in styles
Date: Thu, 20 Jul 2023 04:21:51 -0400 (EDT)

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

    Track last change for \newtheorem macro in styles
    
    * style/amsthm.el ("amsthm"):
    * style/ntheorem.el ("ntheorem"):
    * style/theorem.el ("theorem"): Apply the last change in latex.el
    for query of \newtheorem macro arguments to the styles.
---
 style/amsthm.el   | 15 ++++++++-------
 style/ntheorem.el | 55 ++++++++++++++++++++++++++++++-------------------------
 style/theorem.el  | 15 ++++++++-------
 3 files changed, 46 insertions(+), 39 deletions(-)

diff --git a/style/amsthm.el b/style/amsthm.el
index ad06ff8919..8305ed565f 100644
--- a/style/amsthm.el
+++ b/style/amsthm.el
@@ -1,6 +1,6 @@
 ;;; amsthm.el --- Style hook for the AMS-LaTeX amsthm package.  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 1997--2022  Free Software Foundation, Inc.
+;; Copyright (C) 1997--2023  Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@strw.leidenuniv.nl>
 ;; Maintainer: auctex-devel@gnu.org
@@ -98,12 +98,13 @@ make them available as new environments."
            (LaTeX-add-environments (list nthm #'LaTeX-env-label-args 
["Heading"]))
            (TeX-argument-insert nthm optional)))
       [ TeX-arg-environment "Numbered like" ]
-      t [ (TeX-arg-eval progn (if (eq (save-excursion
-                                        (backward-char 2)
-                                        (preceding-char)) ?\])
-                                  ()
-                                (TeX-arg-counter t "Within counter"))
-                        "") ])
+      "Title"
+      (TeX-arg-conditional (save-excursion
+                             (skip-chars-backward (concat "^" TeX-grcl))
+                             (backward-list)
+                             (= (preceding-char) ?\]))
+          ()
+        ([TeX-arg-counter "Within counter"])))
 
     `("newtheorem*"
       ,(lambda (optional)
diff --git a/style/ntheorem.el b/style/ntheorem.el
index 59455b996e..282c285e55 100644
--- a/style/ntheorem.el
+++ b/style/ntheorem.el
@@ -1,6 +1,6 @@
 ;;; ntheorem.el --- AUCTeX style for `ntheorem.sty' (v1.33)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015-2022  Free Software Foundation, Inc.
+;; Copyright (C) 2015-2023  Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -151,23 +151,25 @@ make them available as new environments.  Update
                                          #'LaTeX-env-label-args ["Heading"]))
            (TeX-argument-insert nthm optional)))
       [ TeX-arg-environment "Numbered like" ]
-      t [ (TeX-arg-eval progn (if (eq (save-excursion
-                                        (backward-char 2)
-                                        (preceding-char)) ?\])
-                                  ()
-                                (TeX-arg-counter t "Within counter"))
-                        "") ])
+      "Title"
+      (TeX-arg-conditional (save-excursion
+                             (skip-chars-backward (concat "^" TeX-grcl))
+                             (backward-list)
+                             (= (preceding-char) ?\]))
+          ()
+        ([TeX-arg-counter "Within counter"])))
 
     '("renewtheorem"
       (TeX-arg-completing-read (LaTeX-ntheorem-newtheorem-list)
                                "Environment")
       [ TeX-arg-environment "Numbered like" ]
-      t [ (TeX-arg-eval progn (if (eq (save-excursion
-                                        (backward-char 2)
-                                        (preceding-char)) ?\])
-                                  ()
-                                (TeX-arg-counter t "Within counter"))
-                        "") ])
+      "Title"
+      (TeX-arg-conditional (save-excursion
+                             (skip-chars-backward (concat "^" TeX-grcl))
+                             (backward-list)
+                             (= (preceding-char) ?\]))
+          ()
+        ([TeX-arg-counter "Within counter"])))
 
     ;; 2.3 Defining the Layout of Theorem Sets
     '("theoremstyle"
@@ -245,12 +247,13 @@ make them available as new environments.  Update
                                          #'LaTeX-env-label-args ["Heading"]))
            (TeX-argument-insert nthm optional)))
       [ TeX-arg-environment "Numbered like" ]
-      t [ (TeX-arg-eval progn (if (eq (save-excursion
-                                        (backward-char 2)
-                                        (preceding-char)) ?\])
-                                  ()
-                                (TeX-arg-counter t "Within counter"))
-                        "") ])
+      "Title"
+      (TeX-arg-conditional (save-excursion
+                             (skip-chars-backward (concat "^" TeX-grcl))
+                             (backward-list)
+                             (= (preceding-char) ?\]))
+          ()
+        ([TeX-arg-counter "Within counter"])))
 
     `("newshadedtheorem"
       ,(lambda (optional)
@@ -263,12 +266,14 @@ make them available as new environments.  Update
                                          #'LaTeX-env-label-args ["Heading"]))
            (TeX-argument-insert nthm optional)))
       [ TeX-arg-environment "Numbered like" ]
-      t [ (TeX-arg-eval progn (if (eq (save-excursion
-                                        (backward-char 2)
-                                        (preceding-char)) ?\])
-                                  ()
-                                (TeX-arg-counter t "Within counter"))
-                        "") ])
+      "Title"
+      (TeX-arg-conditional (save-excursion
+                             (skip-chars-backward (concat "^" TeX-grcl))
+                             (backward-list)
+                             (= (preceding-char) ?\]))
+          ()
+        ([TeX-arg-counter "Within counter"])))
+
     `("shadecolor"
       (TeX-arg-conditional (TeX-member "\\`x?color\\'" (TeX-style-list) 
#'string-match)
           ((TeX-arg-completing-read ,(lambda ()
diff --git a/style/theorem.el b/style/theorem.el
index 52aea651ba..91a3d3917a 100644
--- a/style/theorem.el
+++ b/style/theorem.el
@@ -1,6 +1,6 @@
 ;;; theorem.el --- AUCTeX style for `theorem.sty' (v2.2c)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015-2022  Free Software Foundation, Inc.
+;; Copyright (C) 2015-2023  Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -94,12 +94,13 @@ make them available as new environments."
            (LaTeX-add-environments (list nthm #'LaTeX-env-label-args 
["Heading"]))
            (TeX-argument-insert nthm optional)))
       [ TeX-arg-environment "Numbered like" ]
-      t [ (TeX-arg-eval progn (if (eq (save-excursion
-                                        (backward-char 2)
-                                        (preceding-char)) ?\])
-                                  ()
-                                (TeX-arg-counter t "Within counter"))
-                        "") ])
+      "Title"
+      (TeX-arg-conditional (save-excursion
+                             (skip-chars-backward (concat "^" TeX-grcl))
+                             (backward-list)
+                             (= (preceding-char) ?\]))
+          ()
+        ([TeX-arg-counter "Within counter"])))
 
     '("theoremstyle"
       (TeX-arg-completing-read LaTeX-theorem-theoremstyle-list "Style"))



reply via email to

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