[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 316550f0bf 29/48: Fix `ConTeXt-add-environments'
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 316550f0bf 29/48: Fix `ConTeXt-add-environments' |
Date: |
Fri, 18 Nov 2022 14:27:44 -0500 (EST) |
branch: externals/auctex
commit 316550f0bfa61d197fca7b4a9fc9b864b1b46640
Author: Ikumi Keita <ikumi@ikumi.que.jp>
Commit: Ikumi Keita <ikumi@ikumi.que.jp>
Fix `ConTeXt-add-environments'
* context.el (ConTeXt-environment, ConTeXt-environment-menu): Use
function `ConTeXt-environment-list' to refer to the current
environments list.
(ConTeXt-environment-menu): Follow `LaTeX-environment-menu' to support
optional argument for environments.
* tex.el (TeX-auto-add-type): Use unique key for `TeX-auto-parser' in
order to discriminate ConTeXt environments from LaTeX environments.
* context-en.el (ConTeXt-en-mode-initialization):
* context-nl.el (ConTeXt-nl-mode-initialization):
Add comments.
---
context-en.el | 5 ++++-
context-nl.el | 5 ++++-
context.el | 25 ++++++++++++++-----------
tex.el | 12 ++++++++----
4 files changed, 30 insertions(+), 17 deletions(-)
diff --git a/context-en.el b/context-en.el
index f4b8fdf87c..54f30da3be 100644
--- a/context-en.el
+++ b/context-en.el
@@ -1,7 +1,7 @@
;;; context-en.el --- Support for the ConTeXt english interface. -*-
lexical-binding: t; -*-
;; Copyright (C) 2003-2004, 2006, 2008
-;; 2010, 2014, 2020, 2021 Free Software Foundation, Inc.
+;; 2010, 2014, 2020-2022 Free Software Foundation, Inc.
;; Maintainer: Berend de Boer <berend@pobox.com>
;; Keywords: tex
@@ -188,6 +188,9 @@ That is, besides the section(-block) commands.")
(defun ConTeXt-en-mode-initialization ()
"ConTeXt english interface specific initialization."
+ ;; FIXME: This `mapc' seems spurious because
+ ;; `ConTeXt-language-variable-list' includes
+ ;; `ConTeXt-environment-list'.
(mapc #'ConTeXt-add-environments (reverse ConTeXt-environment-list-en))
(TeX-add-symbols
diff --git a/context-nl.el b/context-nl.el
index 9b49cce236..143a18a388 100644
--- a/context-nl.el
+++ b/context-nl.el
@@ -1,7 +1,7 @@
;;; context-nl.el --- Support for the ConTeXt dutch interface. -*-
lexical-binding: t; -*-
;; Copyright (C) 2003, 2004, 2006, 2010,
-;; 2015, 2020, 2021 Free Software Foundation, Inc.
+;; 2015, 2020-2022 Free Software Foundation, Inc.
;; Maintainer: Berend de Boer <berend@pobox.com>
;; Keywords: tex
@@ -163,6 +163,9 @@ That is, besides the section(-block) commands.")
(defun ConTeXt-nl-mode-initialization ()
"ConTeXt dutch interface specific initialization."
+ ;; FIXME: This `mapc' seems spurious because
+ ;; `ConTeXt-language-variable-list' includes
+ ;; `ConTeXt-environment-list'.
(mapc #'ConTeXt-add-environments (reverse ConTeXt-environment-list-nl))
(TeX-add-symbols
diff --git a/context.el b/context.el
index 50fb1adfee..40eacda811 100644
--- a/context.el
+++ b/context.el
@@ -680,14 +680,14 @@ With optional ARG, modify current environment."
(t ConTeXt-default-environment)))
(environment
(completing-read (concat "Environment type (default " default "): ")
- ConTeXt-environment-list nil nil nil
+ (ConTeXt-environment-list) nil nil nil
'ConTeXt-environment-history default)))
;; Use `environment' as default for the next time only if it is different
;; from the current default.
(unless (equal environment default)
(setq ConTeXt-default-environment environment))
- (let ((entry (assoc environment ConTeXt-environment-list)))
+ (let ((entry (assoc environment (ConTeXt-environment-list))))
(if (null entry)
(ConTeXt-add-environments (list environment)))
@@ -717,7 +717,7 @@ With optional ARG, modify current environment."
(defun ConTeXt-environment-menu (environment)
"Insert ENVIRONMENT around point or region."
- (let ((entry (assoc environment ConTeXt-environment-list)))
+ (let ((entry (assoc environment (ConTeXt-environment-list))))
(cond ((not (and entry (nth 1 entry)))
(ConTeXt-insert-environment environment))
((numberp (nth 1 entry))
@@ -727,16 +727,19 @@ With optional ARG, modify current environment."
(setq args (concat args TeX-grop TeX-grcl))
(setq count (- count 1)))
(ConTeXt-insert-environment environment args)))
- ((stringp (nth 1 entry))
+ ((or (stringp (nth 1 entry)) (vectorp (nth 1 entry)))
(let ((prompts (cdr entry))
(args ""))
- (while prompts
- (setq args (concat args
- TeX-grop
- (read-from-minibuffer
- (concat (car prompts) ": "))
- TeX-grcl))
- (setq prompts (cdr prompts)))
+ (dolist (elt prompts)
+ (let* ((optional (vectorp elt))
+ (elt (if optional (elt elt 0) elt))
+ (arg (TeX-read-string
+ (TeX-argument-prompt optional elt nil))))
+ (setq args (concat args
+ (cond ((and optional (> (length arg) 0))
+ (concat ConTeXt-optop arg
ConTeXt-optcl))
+ ((not optional)
+ (concat TeX-grop arg TeX-grcl)))))))
(ConTeXt-insert-environment environment args)))
(t
(apply (nth 1 entry) environment (nthcdr 2 entry))))))
diff --git a/tex.el b/tex.el
index 317b8b490d..5cb86af1f1 100644
--- a/tex.el
+++ b/tex.el
@@ -3918,7 +3918,10 @@ separate type of information in the parser."
(change (intern (concat prefix "-" name "-changed")))
(vardoc (concat "Information about " names
" in the current buffer.
-Generated by `TeX-auto-add-type'.")))
+Generated by `TeX-auto-add-type'."))
+ ;; Avoid clash between LaTeX environments and ConTeXt
+ ;; environments in keys of `TeX-auto-parser'.
+ (unique-key (concat prefix "-" name)))
`(progn
(defvar ,tmp nil ,vardoc)
(defvar ,local nil ,vardoc)
@@ -3929,15 +3932,16 @@ Generated by `TeX-auto-add-type'.")))
,(concat "Add information about " (upcase names)
" to the current buffer.
Generated by `TeX-auto-add-type'.")
- (TeX-auto-add-information ,name ,(intern names)))
+ (TeX-auto-add-information ,unique-key ,(intern names)))
(defun ,local ()
,(concat "List of " names
" active in the current buffer.
Generated by `TeX-auto-add-type'.")
- (TeX-auto-list-information ,name))
+ (TeX-auto-list-information ,unique-key))
;; Append new type to `TeX-auto-parser' in order to make `style' type
;; always the first.
- (add-to-list 'TeX-auto-parser ',(list name tmp add local change) t)
+ (add-to-list 'TeX-auto-parser
+ ',(list unique-key tmp add local change) t)
(add-hook 'TeX-remove-style-hook
(lambda ()
(setq ,local nil))))))
- [elpa] externals/auctex ff5a83f345 17/48: Simplify implementation of style/thm-restate.el, (continued)
- [elpa] externals/auctex ff5a83f345 17/48: Simplify implementation of style/thm-restate.el, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 0ee39626e4 01/48: Use `TeX-arg-completing-read', Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 5949388ca2 12/48: Simplify argument queries in style/wrapfig.el, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 47f9ead1c6 44/48: Respect `TeX-exit-mark' when inserting enviroments, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex c6c7c3f024 22/48: ; Use #' to quote function, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex c0c9556338 30/48: Don't insert empty node name, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 978ebea1e8 16/48: Simplify implementation of style/thmtools.el, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex d3970b77da 09/48: ; * latex.el (LaTeX-common-initialization): Remove dupe textcircled., Tassilo Horn, 2022/11/18
- [elpa] externals/auctex a0ba387b2c 23/48: ; Trivial cleanups, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 04a3138c81 45/48: Simplify implementation of style/theorem.el, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 316550f0bf 29/48: Fix `ConTeXt-add-environments',
Tassilo Horn <=
- [elpa] externals/auctex 8775c8355f 13/48: Replace `TeX-arg-url-urlstyle' in style/url.el, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex a7a7209a08 33/48: Extend the argument list of some functions, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex c8d638ac9d 40/48: Use `functionp' to recognize a function, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 835e01ddb6 36/48: Extend the argument list of `TeX-arg-string', Tassilo Horn, 2022/11/18
- [elpa] externals/auctex e83a4b87b3 25/48: Use the correct function to retrieve the key=vals, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex a617944b4b 08/48: Fix style/xspace.el, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 50c0fb3d31 46/48: * style/afterpage.el ("afterpage"): Fontify the only macro., Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 82a23a93ae 43/48: Add some variables containing font declarations, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 93430d7ab0 48/48: Merge remote-tracking branch 'origin/master' into externals/auctex, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 7642155b73 03/48: Don't let-bind `inhibit-point-motion-hooks' to t, Tassilo Horn, 2022/11/18