auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] GNU AUCTeX branch, master, updated. 2db5e3cf30383cff2f128


From: Arash Esbati
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 2db5e3cf30383cff2f128530f7932fb0fd8d2b22
Date: Wed, 10 Nov 2021 04:54:43 -0500 (EST)

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, master has been updated
       via  2db5e3cf30383cff2f128530f7932fb0fd8d2b22 (commit)
      from  df0545f332a064b95c76a843b1def54df7742143 (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 2db5e3cf30383cff2f128530f7932fb0fd8d2b22
Author: Arash Esbati <arash@gnu.org>
Date:   Wed Nov 10 10:49:14 2021 +0100

    Improve handling of key=vals style/newfloat.el
    
    * style/newfloat.el (LaTeX-empheq-key-val-options-local): Remove
    now unused variable.
    (LaTeX-newfloat-key-val-options): New function returning key=vals.
    ("newfloat"): Use new function `LaTeX-newfloat-key-val-options'.

diff --git a/style/newfloat.el b/style/newfloat.el
index 3eb865c..74185bd 100644
--- a/style/newfloat.el
+++ b/style/newfloat.el
@@ -1,6 +1,6 @@
 ;;; newfloat.el --- AUCTeX style for `newfloat.sty' (v1.1-109)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2015, 2018, 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2015--2021 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -71,9 +71,13 @@
     ("chapterlistsgaps" ("on" "off")))
   "Key=value options for newfloat macros.")
 
-(defvar LaTeX-newfloat-key-val-options-local nil
-  "Buffer-local Key=value options for newfloat macros.")
-(make-variable-buffer-local 'LaTeX-newfloat-key-val-options-local)
+(defun LaTeX-newfloat-key-val-options ()
+  "Return newfloat key=vals based on variable `LaTeX-largest-level'."
+  (append
+   (if (< (LaTeX-largest-level) 2)
+       '(("within" ("chapter" "section" "none")))
+     '(("within" ("section" "none"))))
+   LaTeX-newfloat-key-val-options))
 
 ;; Setup parsing for \DeclareFloatingEnvironment:
 (TeX-auto-add-type "newfloat-DeclareFloatingEnvironment" "LaTeX")
@@ -88,8 +92,7 @@
              "{\\([^}]+\\)}"
              "\\(?:[ %]*{\\([^}]*\\)}\\)?")
     (1 2) LaTeX-auto-newfloat-DeclareFloatingEnvironment)
-  "Matches the argument of `\\DeclareFloatingEnvironment' from
-`newfloat.sty'.")
+  "Matches the argument of `\\DeclareFloatingEnvironment' from 
`newfloat.sty'.")
 
 (defun LaTeX-newfloat-auto-prepare ()
   "Clear `LaTeX-auto-newfloat-DeclareFloatingEnvironment' before parsing."
@@ -151,21 +154,10 @@ If `caption.el' is loaded, add the new floating 
environment to
    ;; Add newfloat to the parser.
    (TeX-auto-add-regexp LaTeX-newfloat-DeclareFloatingEnvironment-regex)
 
-   ;; Depending on class, add "within" key to the local options list
-   ;; and use it.
-   (setq LaTeX-newfloat-key-val-options-local
-         (copy-alist LaTeX-newfloat-key-val-options))
-
-   (if (< (LaTeX-largest-level) 2)
-       (add-to-list 'LaTeX-newfloat-key-val-options-local
-                    '("within" ("chapter" "section" "none")))
-     (add-to-list 'LaTeX-newfloat-key-val-options-local
-                  '("within" ("section" "none"))))
-
    ;; Commands:
    (TeX-add-symbols
     '("DeclareFloatingEnvironment"
-      [TeX-arg-key-val LaTeX-newfloat-key-val-options-local]
+      [TeX-arg-key-val (LaTeX-newfloat-key-val-options)]
       (TeX-arg-eval
        (lambda ()
          (let ((newfloat (TeX-read-string
@@ -177,7 +169,7 @@ If `caption.el' is loaded, add the new floating environment 
to
       (TeX-arg-eval completing-read
                     (TeX-argument-prompt nil nil "Floating environment")
                     (mapcar #'car 
(LaTeX-newfloat-DeclareFloatingEnvironment-list)))
-      (TeX-arg-key-val LaTeX-newfloat-key-val-options-local))
+      (TeX-arg-key-val (LaTeX-newfloat-key-val-options-local)))
 
     '("ForEachFloatingEnvironment" t)
     '("ForEachFloatingEnvironment*" t)

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

Summary of changes:
 style/newfloat.el | 30 +++++++++++-------------------
 1 file changed, 11 insertions(+), 19 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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