auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] GNU AUCTeX branch, lexical-binding-attempt-1, updated. 6f


From: Tassilo Horn
Subject: [AUCTeX-diffs] GNU AUCTeX branch, lexical-binding-attempt-1, updated. 6fcbaf5ea64b76553ad29437d969c93a2a006cd9
Date: Sat, 5 Sep 2020 07:33:51 -0400 (EDT)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU AUCTeX".

The branch, lexical-binding-attempt-1 has been updated
       via  6fcbaf5ea64b76553ad29437d969c93a2a006cd9 (commit)
      from  319dde171431ada3954b886f51a851858e25561e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 6fcbaf5ea64b76553ad29437d969c93a2a006cd9
Author: Tassilo Horn <tsdh@gnu.org>
Date:   Sat Sep 5 13:33:41 2020 +0200

    Drop LaTeX-insert-item-environment, we don't need it

diff --git a/latex.el b/latex.el
index 0f9d333..2dc00ba 100644
--- a/latex.el
+++ b/latex.el
@@ -1397,21 +1397,17 @@ out."
   "A list of environments where items have a special syntax.
 The cdr is the name of the function, used to insert this kind of items.")
 
-(defvar LaTeX-insert-item-environment nil
-  "The environment to which an item is going to be inserted.
-Dynamically bound by `LaTeX-insert-item'.")
-
 (defun LaTeX-insert-item ()
   "Insert a new item in an environment.
 You may use `LaTeX-item-list' to change the routines used to insert the item."
   (interactive "*")
-  (let ((LaTeX-insert-item-environment (LaTeX-current-environment)))
+  (let ((environment (LaTeX-current-environment)))
     (when (and (TeX-active-mark)
               (> (point) (mark)))
       (exchange-point-and-mark))
     (unless (bolp) (LaTeX-newline))
-    (if (assoc LaTeX-insert-item-environment LaTeX-item-list)
-       (funcall (cdr (assoc LaTeX-insert-item-environment LaTeX-item-list)))
+    (if (assoc environment LaTeX-item-list)
+       (funcall (cdr (assoc environment LaTeX-item-list)))
       (TeX-insert-macro "item"))
     (indent-according-to-mode)))
 
diff --git a/style/exam.el b/style/exam.el
index 7a58e52..1dd7b2b 100644
--- a/style/exam.el
+++ b/style/exam.el
@@ -48,27 +48,24 @@
 (dolist (opt LaTeX-article-class-options)
   (add-to-list 'LaTeX-exam-class-options opt))
 
-;; Defined in latex.el and bound by `LaTeX-insert-item'.
-(defvar LaTeX-insert-item-environment)
-
 (defun LaTeX-exam-insert-item ()
-  "Insert a new item in an LaTeX-insert-item-environment from exam class.
+  "Insert a new item in the current environment from exam class.
 Item inserted depends on the environment."
-  (TeX-insert-macro
-   (cond ((string= LaTeX-insert-item-environment "questions")
-          "question")
-         ((string= LaTeX-insert-item-environment "parts")
-          "part")
-         ((string= LaTeX-insert-item-environment "subparts")
-          "subpart")
-         ((string= LaTeX-insert-item-environment "subsubparts")
-          "subsubpart")
-        ((member LaTeX-insert-item-environment
-                  '("choices" "oneparchoices"
-                   "checkboxes" "oneparcheckboxes"))
-         "choice")
-         ;; Fallback
-         (t "item"))))
+  (let ((env (LaTeX-current-environment)))
+    (TeX-insert-macro
+     (cond ((string= env "questions")
+            "question")
+           ((string= env "parts")
+            "part")
+           ((string= env "subparts")
+            "subpart")
+           ((string= env "subsubparts")
+            "subsubpart")
+          ((member env '("choices" "oneparchoices"
+                         "checkboxes" "oneparcheckboxes"))
+           "choice")
+           ;; Fallback
+           (t "item")))))
 
 (defun LaTeX-exam-insert-label (_optional &optional name type)
   "Indent the line and query/insert a label incl. the \"\\label\" macro.

-----------------------------------------------------------------------

Summary of changes:
 latex.el      | 10 +++-------
 style/exam.el | 35 ++++++++++++++++-------------------
 2 files changed, 19 insertions(+), 26 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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