[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-diffs] [elpa] externals/auctex 2db5e3c 40/71: Improve handling o
From: |
Tassilo Horn |
Subject: |
[AUCTeX-diffs] [elpa] externals/auctex 2db5e3c 40/71: Improve handling of key=vals style/newfloat.el |
Date: |
Fri, 17 Dec 2021 15:00:33 -0500 (EST) |
branch: externals/auctex
commit 2db5e3cf30383cff2f128530f7932fb0fd8d2b22
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>
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'.
---
style/newfloat.el | 30 +++++++++++-------------------
1 file changed, 11 insertions(+), 19 deletions(-)
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)
- [AUCTeX-diffs] [elpa] externals/auctex b9545c8 45/71: Improve handling of key=vals in style/fancyvrb.el, (continued)
- [AUCTeX-diffs] [elpa] externals/auctex b9545c8 45/71: Improve handling of key=vals in style/fancyvrb.el, Tassilo Horn, 2021/12/17
- [AUCTeX-diffs] [elpa] externals/auctex bd2f3a8 63/71: Track changes in LaTeX kernel 2021-11-15, Tassilo Horn, 2021/12/17
- [AUCTeX-diffs] [elpa] externals/auctex d77f49e 54/71: Fontify \tabularnewline macro, Tassilo Horn, 2021/12/17
- [AUCTeX-diffs] [elpa] externals/auctex df0545f 39/71: Improve handling of key=vals in style/empheq.el, Tassilo Horn, 2021/12/17
- [AUCTeX-diffs] [elpa] externals/auctex 9fdb117 67/71: ; Fix previous commit, Tassilo Horn, 2021/12/17
- [AUCTeX-diffs] [elpa] externals/auctex 8e13306 66/71: Update style/url.el to package version 3.4, Tassilo Horn, 2021/12/17
- [AUCTeX-diffs] [elpa] externals/auctex 9fa3859 38/71: ; Remove duplicates, Tassilo Horn, 2021/12/17
- [AUCTeX-diffs] [elpa] externals/auctex 19cd047 69/71: Add new style/rotating.el, Tassilo Horn, 2021/12/17
- [AUCTeX-diffs] [elpa] externals/auctex 25c8d0f 12/71: Add NEWS for two commands available in Texinfo mode, Tassilo Horn, 2021/12/17
- [AUCTeX-diffs] [elpa] externals/auctex 0376fd2 32/71: ; Fix doc strings, Tassilo Horn, 2021/12/17
- [AUCTeX-diffs] [elpa] externals/auctex 2db5e3c 40/71: Improve handling of key=vals style/newfloat.el,
Tassilo Horn <=
- [AUCTeX-diffs] [elpa] externals/auctex 17277d8 65/71: Fix marker management, Tassilo Horn, 2021/12/17