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. 8bc74dd3adcde6c7b072a


From: Arash Esbati
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 8bc74dd3adcde6c7b072abafe3c31ba2e05d5f7d
Date: Sun, 24 Jan 2021 09:36:30 -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  8bc74dd3adcde6c7b072abafe3c31ba2e05d5f7d (commit)
      from  ba0b1af33f04378d9dd8758921717d71a1c6cac7 (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 8bc74dd3adcde6c7b072abafe3c31ba2e05d5f7d
Author: Arash Esbati <arash@gnu.org>
Date:   Sun Jan 24 15:35:32 2021 +0100

    Update style/bigdelim.el to package version 2.6
    
    * style/bigdelim.el (TeX-arg-bigdelim-brace): Support completion
    for more brace choices.  Insert the choice in braces only if the
    choice doesn't start with a backslash.
    ("bigdelim"): Add fontification support.

diff --git a/style/bigdelim.el b/style/bigdelim.el
index 30938d3..7f0dee5 100644
--- a/style/bigdelim.el
+++ b/style/bigdelim.el
@@ -1,6 +1,6 @@
 ;;; bigdelim.el --- AUCTeX style for `bigdelim.sty'  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2011, 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011--2021 Free Software Foundation, Inc.
 
 ;; Author: Mads Jensen <mje@inducks.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -26,28 +26,74 @@
 
 ;;; Commentary:
 
-;; This file adds support for `bigdelim.sty'.
+;; This file adds support for `bigdelim.sty', v2.6 from 2021/01/02.
 
 ;;; Code:
 
 (require 'tex)
 
+;; Silence the compiler:
+(declare-function font-latex-add-keywords
+                 "font-latex"
+                 (keywords class))
+
+(defun TeX-arg-bigdelim-brace (optional side &optional prompt)
+  "Prompt for a single brace, and do not insert the matching one.
+If OPTIONAL is non-nil, include the argument only if not empty.
+SIDE is one of the symbols `left' or `right'. PROMPT replaces the
+standard one."
+  (let* ((brace (completing-read
+                 (TeX-argument-prompt optional prompt "Brace")
+                 (if (eq side 'left)
+                     '("(" "[" "{" "\\langle" "|" "\\|" "\\lceil" "\\lfloor")
+                   '(")" "]" "}" "\\rangle" "|" "\\|" "\\rceil" "\\rfloor"))))
+         (TeX-arg-opening-brace (if (member (substring brace 0 1)
+                                            `("{" "}" ,TeX-esc))
+                                    ""
+                                  TeX-grop))
+         (TeX-arg-closing-brace (if (string= TeX-arg-opening-brace TeX-grop)
+                                    TeX-grcl
+                                 "")))
+    (TeX-argument-insert brace optional (when (member brace '("{" "}"))
+                                          TeX-esc))))
+
 (TeX-add-style-hook
  "bigdelim"
  (lambda ()
+
+   (TeX-run-style-hooks "multirow")
+
    (TeX-add-symbols
-    '("ldelim" TeX-arg-bigdelim-brace "Number of rows for multirow"
-      "Width in multirow" [ "Text in multirow" ])
-    '("rdelim" TeX-arg-bigdelim-brace "Number of rows for multirow"
-      "Width in multirow" [ "Text in multirow" ])))
- TeX-dialect)
+    '("ldelim"
+      (TeX-arg-bigdelim-brace left)
+      "Number of rows for multirow"
+      (TeX-arg-eval completing-read
+                    (TeX-argument-prompt nil nil "Width in multirow")
+                    (append
+                     '("*")
+                     (mapcar (lambda (x)
+                               (concat TeX-esc (car x)))
+                             (LaTeX-length-list))))
+      [ "Text in multirow" ])
+    '("rdelim"
+      (TeX-arg-bigdelim-brace right)
+      "Number of rows for multirow"
+      (TeX-arg-eval completing-read
+                    (TeX-argument-prompt nil nil "Width in multirow")
+                    (append
+                     '("*")
+                     (mapcar (lambda (x)
+                               (concat TeX-esc (car x)))
+                             (LaTeX-length-list))))
+      [ "Text in multirow" ]))
 
-(defun TeX-arg-bigdelim-brace (optional &optional prompt)
-  "Prompt for a single brace, and do not insert the matching
-  right parentheses."
-  (let ((brace (read-from-minibuffer
-   (TeX-argument-prompt optional prompt "Brace") nil)))
-    (insert (format "%s" brace))))
+   ;; Fontification
+   (when (and (featurep 'font-latex)
+              (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("ldelim" "|{\\{{[")
+                                ("rdelim" "|{\\{{["))
+                              'function)))
+ TeX-dialect)
 
 (defvar LaTeX-bigdelim-package-options nil
   "Package options for the bigdelim package.")

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

Summary of changes:
 style/bigdelim.el | 72 +++++++++++++++++++++++++++++++++++++++++++++----------
 1 file changed, 59 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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