[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-diffs] [elpa] externals/auctex 259ffc34c4 12/60: Use DEFAULT arg
From: |
Tassilo Horn |
Subject: |
[AUCTeX-diffs] [elpa] externals/auctex 259ffc34c4 12/60: Use DEFAULT argument of `TeX-read-string' in styles |
Date: |
Fri, 8 Apr 2022 11:52:47 -0400 (EDT) |
branch: externals/auctex
commit 259ffc34c474f559d840e5ab4701780629bc8791
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>
Use DEFAULT argument of `TeX-read-string' in styles
* style/longtable.el (LaTeX-env-longtable):
* style/ocg-p.el (LaTeX-env-ocgp-ocgtabular):
* style/plext.el (LaTeX-plext-env-array):
* style/xltabular.el (LaTeX-env-xltabular): Use the DEFAULT
argument in `TeX-read-string' where applicable.
---
style/longtable.el | 21 ++++++++++++++++-----
style/ocg-p.el | 11 +++++++++--
style/plext.el | 15 ++++++++++++---
style/xltabular.el | 28 +++++++++++++++++++++-------
4 files changed, 58 insertions(+), 17 deletions(-)
diff --git a/style/longtable.el b/style/longtable.el
index 2646e339ab..8db4083c66 100644
--- a/style/longtable.el
+++ b/style/longtable.el
@@ -1,6 +1,6 @@
;;; longtable.el --- AUCTeX style for `longtable.sty'. -*- lexical-binding:
t; -*-
-;; Copyright (C) 2013--2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013--2022 Free Software Foundation, Inc.
;; Maintainer: auctex-devel@gnu.org
;; Author: Mosè Giordano <mose@gnu.org>
@@ -56,13 +56,24 @@ insert line break macro."
(defun LaTeX-env-longtable (environment)
"Insert a longtable-like ENVIRONMENT with caption and label."
- (let* ((pos (completing-read (TeX-argument-prompt t nil "Position")
- '(("l") ("r") ("c"))))
- (fmt (TeX-read-string "Format: " LaTeX-default-format))
+ (let* ((pos (and LaTeX-default-position ; `LaTeX-default-position'
+ ; can be nil, i.e. no prompt
+ (completing-read (TeX-argument-prompt t nil "Position")
+ '("l" "r" "c")
+ nil nil LaTeX-default-position)))
+ (fmt (TeX-read-string
+ (if (string= LaTeX-default-format "")
+ "Format: "
+ (format "Format (default %s): " LaTeX-default-format))
+ nil nil
+ (if (string= LaTeX-default-format "")
+ nil
+ LaTeX-default-format)))
(caption (TeX-read-string "Caption: "))
(short-caption (when (>= (length caption)
LaTeX-short-caption-prompt-length)
(TeX-read-string "(Optional) Short caption: "))))
- (setq LaTeX-default-format fmt)
+ (setq LaTeX-default-position pos
+ LaTeX-default-format fmt)
(LaTeX-insert-environment environment
(concat
(unless (zerop (length pos))
diff --git a/style/ocg-p.el b/style/ocg-p.el
index 26f881f445..d3ab40da89 100644
--- a/style/ocg-p.el
+++ b/style/ocg-p.el
@@ -1,6 +1,6 @@
;;; ocg-p.el --- AUCTeX style for `ocg-p.sty' (v0.4) -*- lexical-binding: t;
-*-
-;; Copyright (C) 2018, 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018--2022 Free Software Foundation, Inc.
;; Author: Arash Esbati <arash@gnu.org>
;; Maintainer: auctex-devel@gnu.org
@@ -123,7 +123,14 @@ Just like array and tabular."
(let ((pos (and LaTeX-default-position ; LaTeX-default-position can
; be nil, i.e. do not prompt
(TeX-read-string "(Optional) Position: "
LaTeX-default-position)))
- (fmt (TeX-read-string "Format: " LaTeX-default-format))
+ (fmt (TeX-read-string
+ (if (string= LaTeX-default-format "")
+ "Format: "
+ (format "Format (default %s): " LaTeX-default-format))
+ nil nil
+ (if (string= LaTeX-default-format "")
+ nil
+ LaTeX-default-format)))
(dbase (TeX-read-string "Database name: "))
(opts (TeX-read-string "Additional options: ")))
(setq LaTeX-default-position pos)
diff --git a/style/plext.el b/style/plext.el
index 8b4cf0b3f3..26e564e584 100644
--- a/style/plext.el
+++ b/style/plext.el
@@ -1,6 +1,6 @@
;;; plext.el --- AUCTeX style for the plext package. -*- lexical-binding: t;
-*-
-;; Copyright (C) 2014, 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2014, 2020, 2022 Free Software Foundation, Inc.
;; Author: Ikumi Keita <ikumi@ikumi.que.jp>
;; Maintainer: auctex-devel@gnu.org
@@ -55,11 +55,20 @@
(defun LaTeX-plext-env-array (env)
(let ((dir (TeX-read-string "(Optional) Direction (t or y or z): "))
(width (if (string= env "tabular*")
- (TeX-read-string "Width: " LaTeX-default-width)))
+ (TeX-read-string
+ (format "Width (default %s): " LaTeX-default-width)
+ nil nil LaTeX-default-width)))
(pos (and LaTeX-default-position ; LaTeX-default-position can
; be nil, i.e. do not prompt
(TeX-read-string "(Optional) Position: "
LaTeX-default-position)))
- (fmt (TeX-read-string "Format: " LaTeX-default-format)))
+ (fmt (TeX-read-string
+ (if (string= LaTeX-default-format "")
+ "Format: "
+ (format "Format (default %s): " LaTeX-default-format))
+ nil nil
+ (if (string= LaTeX-default-format "")
+ nil
+ LaTeX-default-format))))
(unless (zerop (length dir))
(setq dir (concat "<" dir ">")))
(if (string= env "tabular*")
diff --git a/style/xltabular.el b/style/xltabular.el
index 09c5a97248..3fb3e0d220 100644
--- a/style/xltabular.el
+++ b/style/xltabular.el
@@ -1,6 +1,6 @@
;;; xltabular.el --- AUCTeX style for `xltabular.sty' (v0.05) -*-
lexical-binding: t; -*-
-;; Copyright (C) 2017, 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017--2022 Free Software Foundation, Inc.
;; Author: Arash Esbati <arash@gnu.org>
;; Maintainer: auctex-devel@gnu.org
@@ -49,15 +49,29 @@ nested curly brace pair nor escaped \"}\".")
;; Optional <hPos> comes before <width>, hence we cannot use
;; `LaTeX-env-tabular*' here and has to cook our own function which
;; is a combination of `LaTeX-env-tabular*' and
- ;; `LaTeX-env-longtable':
- (let* ((pos (completing-read (TeX-argument-prompt t nil "Position")
- '("l" "r" "c")))
- (width (TeX-read-string "Width: " LaTeX-default-width))
- (fmt (TeX-read-string "Format: " LaTeX-default-format))
+ ;; `LaTeX-env-longtable'. Note that `LaTeX-default-position' can be
+ ;; nil, i.e. do not prompt:
+ (let* ((pos (and LaTeX-default-position
+ (completing-read (TeX-argument-prompt t nil "Position")
+ '("l" "r" "c")
+ nil nil LaTeX-default-position)))
+ (width (TeX-read-string
+ (format "Width (default %s): " LaTeX-default-width)
+ nil nil LaTeX-default-width))
+ (fmt (TeX-read-string
+ (if (string= LaTeX-default-format "")
+ "Format: "
+ (format "Format (default %s): " LaTeX-default-format))
+ nil nil
+ (if (string= LaTeX-default-format "")
+ nil
+ LaTeX-default-format)))
(caption (TeX-read-string "Caption: "))
(short-caption (when (>= (length caption)
LaTeX-short-caption-prompt-length)
(TeX-read-string "(Optional) Short caption: "))))
- (setq LaTeX-default-format fmt)
+ (setq LaTeX-default-position pos
+ LaTeX-default-width width
+ LaTeX-default-format fmt)
(LaTeX-insert-environment environment
(concat
(unless (zerop (length pos))
- [AUCTeX-diffs] [elpa] externals/auctex 1823017839 55/60: Wrap the 'function' environment better with %, (continued)
- [AUCTeX-diffs] [elpa] externals/auctex 1823017839 55/60: Wrap the 'function' environment better with %, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 36655f6a5e 24/60: Revert "Fix simultaneity", Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex fce8b94ca8 41/60: Update documentation with respect to indent, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 8938787491 37/60: ; * style/algpseudocode.el ("algpseudocode"): Fix "While"., Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex eb4e331bd6 51/60: Add news for new indent feature, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex a2724f3677 15/60: Don't set syntax-propertize-function in defaults, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex e83ca6a072 57/60: Update style/doc.el to package version 3.0h, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex f9356664c8 23/60: Update documentation, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 78cf12b33c 18/60: ; * doc/auctex.texi: Adjust the year in @copying., Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex c731038844 11/60: Improve regexp matching new environments, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 259ffc34c4 12/60: Use DEFAULT argument of `TeX-read-string' in styles,
Tassilo Horn <=
- [AUCTeX-diffs] [elpa] externals/auctex 0ce906cfc7 32/60: Improve indentation of conditionals, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex b7d45e19c6 22/60: Discard obsolete hook, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 2b11084455 30/60: ; * style/l3doc.el (LaTeX-env-l3doc-function): Delete unused var., Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 238dad67f9 04/60: Introduce DEFAULT argument in `TeX-arg-length', Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 7b0cbbb465 38/60: Document feature of []-induced indent, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 4b1c7015ae 45/60: Move contents of tex-buf.el into tex.el, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex e032df90e7 05/60: Fix simultaneity, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex a078fda16b 06/60: ; * doc/auctex.texi (Starting a Command): Delete obosolete comment., Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex b1a0d5df74 36/60: ; * style/algpseudocode.el: Fix position of TeX-dialect., Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 1bc2630275 20/60: Don't change syntax of ^^A comments in doctex mode (bug#35140), Tassilo Horn, 2022/04/08