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. 259ffc34c474f559d840e


From: Arash Esbati
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 259ffc34c474f559d840e5ab4701780629bc8791
Date: Wed, 2 Mar 2022 07:56: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  259ffc34c474f559d840e5ab4701780629bc8791 (commit)
      from  c731038844f059d2395f3fc2bc79fbe01485a3d9 (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 259ffc34c474f559d840e5ab4701780629bc8791
Author: Arash Esbati <arash@gnu.org>
Date:   Wed Mar 2 13:55:38 2022 +0100

    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.

diff --git a/style/longtable.el b/style/longtable.el
index 2646e339..8db4083c 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 26f881f4..d3ab40da 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 8b4cf0b3..26e564e5 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 09c5a972..3fb3e0d2 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))

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

Summary of changes:
 style/longtable.el | 21 ++++++++++++++++-----
 style/ocg-p.el     | 11 +++++++++--
 style/plext.el     | 15 ++++++++++++---
 style/xltabular.el | 28 +++++++++++++++++++++-------
 4 files changed, 58 insertions(+), 17 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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