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. 799c844ae4fa2b4cde098


From: Arash Esbati
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 799c844ae4fa2b4cde098a7b42b93c0455bf4acb
Date: Thu, 22 Aug 2019 17:36:24 -0400 (EDT)

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  799c844ae4fa2b4cde098a7b42b93c0455bf4acb (commit)
       via  2c232474a6406fa7683ffaa70406757904423a46 (commit)
       via  c64d8c1f1e32181c4c99bf810ac82c7e2a7ababb (commit)
      from  f127145cca3659063acad102431cff7ec0999f1b (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 799c844ae4fa2b4cde098a7b42b93c0455bf4acb
Author: Arash Esbati <address@hidden>
Date:   Thu Aug 22 23:34:51 2019 +0200

    Add new style/changelog.el
    
    * Makefile.in (STYLESRC): Add new style.
    
    * style/changelog.el: New file.

diff --git a/Makefile.in b/Makefile.in
index 74659f7..d3da99e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -169,7 +169,7 @@ STYLESRC = style/prosper.el \
           style/xltabular.el style/marginnote.el style/thmtools.el \
           style/ocg-p.el     style/ocgx.el      style/thm-restate.el \
           style/pythontex.el style/dashundergaps.el style/beamerarticle.el \
-          style/beamerswitch.el
+          style/changelog.el style/beamerswitch.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/style/changelog.el b/style/changelog.el
new file mode 100644
index 0000000..b307ec2
--- /dev/null
+++ b/style/changelog.el
@@ -0,0 +1,154 @@
+;;; changelog.el --- AUCTeX style for `changelog.sty' (v2.0.0)
+
+;; Copyright (C) 2019 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <address@hidden>
+;; Maintainer: address@hidden
+;; Created: 2019-05-05
+;; Keywords: tex
+
+;; This file is part of AUCTeX.
+
+;; AUCTeX is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; AUCTeX is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with AUCTeX; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+;; 02110-1301, USA.
+
+;;; Commentary:
+
+;; This file adds support for `changelog.sty' (v2.0.0).
+;; `changelog.sty' is part of TeXLive.
+
+;;; Code:
+
+(defvar LaTeX-changelog-env-key-val-options
+  '(("section" ("true" "false"))
+    ("title"))
+  "Key=value options for changelog environment.
+The keys sectioncmd and label are added in the function
+`LaTeX-env-changelog'.")
+
+(defvar LaTeX-changelog-version-env-key-val-options
+  '(("version")
+    ("v")
+    ("author")
+    ("date")
+    ("yanked" ("true" "false"))
+    ("simple" ("true" "false"))
+    ("short"  ("true" "false")))
+  "key=value options for version environment.")
+
+(defun LaTeX-env-changelog (environment)
+  "Insert ENVIRONMENT, ask for optional argument and insert a label."
+  (let* ((seccmds (mapcar #'car LaTeX-section-list))
+        ;; Collect the key=vals acc. to environment & documentclass
+        (opts (TeX-read-key-val
+               t
+               (if (string= environment "changelog")
+                   (append
+                    `(("sectioncmd"
+                       ,(if (< (LaTeX-largest-level) 2)
+                            (append
+                             (mapcar (lambda (cmd) (concat TeX-esc cmd))
+                                     seccmds)
+                             (mapcar (lambda (cmd) (concat TeX-esc cmd "*"))
+                                     seccmds))
+                          (append
+                           (mapcar (lambda (cmd) (concat TeX-esc cmd))
+                                   (remove "chapter" seccmds))
+                           (mapcar (lambda (cmd) (concat TeX-esc cmd "*"))
+                                   (remove "chapter" seccmds))))))
+                    LaTeX-changelog-env-key-val-options
+                    LaTeX-changelog-version-env-key-val-options)
+                 LaTeX-changelog-version-env-key-val-options)))
+        ;; Extract the chosen sectioning command
+        (sec (progn
+               (string-match "sectioncmd=\\\\\\([a-z]+\\)\\(\\*?\\)" opts)
+               (match-string-no-properties 1 opts)))
+        ;; Temp. re-bind `LaTeX-label-alist' and pick the label
+        ;; prefix from `LaTeX-section-label'
+        (LaTeX-label-alist
+         (when (and (string= environment "changelog")
+                    (match-string 2 opts)
+                    (not (string= (match-string 2 opts) "*")))
+           `(,(cons environment
+                    (cdr (assoc sec LaTeX-section-label))))))
+        ;; Temp. re-bind `reftex-label-alist' as well and make
+        ;; `reftex-label' DTRT:
+        (reftex-label-alist
+         (when (and (boundp 'reftex-label-alist)
+                    LaTeX-label-alist
+                    (string= environment "changelog"))
+           `((,environment ?s ,(cdr (assoc sec LaTeX-section-label)) nil t)))))
+    (LaTeX-insert-environment
+     environment
+     (when (and opts (not (string= opts "")))
+       (concat LaTeX-optop opts LaTeX-optcl)))
+    ;; Add a label into the opt. argument
+    (when (string= environment "changelog")
+      (LaTeX-env-label-as-keyval nil "sectioncmd" nil environment))
+    ;; Add an \item in version environment
+    (when (string= environment "version")
+      (TeX-insert-macro "item")
+      (indent-according-to-mode))))
+
+(TeX-add-style-hook
+ "changelog"
+ (lambda ()
+
+   (LaTeX-add-environments
+    '("changelog" LaTeX-env-changelog)
+    '("version"   LaTeX-env-changelog))
+
+   (TeX-add-symbols
+    '("added"      0)
+    '("changed"    0)
+    '("deprecated" 0)
+    '("removed"    0)
+    '("fixed"      0)
+    '("security"   0)
+    `("shortversion" (TeX-arg-key-val
+                     ,(append
+                       '(("changes"))
+                       LaTeX-changelog-version-env-key-val-options))))
+
+   ;; Tell RefTeX that the optional arg of changelog env. can contain a label:
+   (when (and (boundp 'reftex-label-regexps)
+             (fboundp 'reftex-compile-variables)
+             (not (string-match  "\\bchangelog\\b"
+                                 (mapconcat #'identity
+                                            reftex-label-regexps
+                                            "|"))))
+     (add-to-list (make-local-variable 'reftex-label-regexps)
+                 (concat "\\\\begin{changelog}"
+                         (LaTeX-extract-key-value-label nil 1))
+                 t)
+     (reftex-compile-variables))
+
+   ;; Fontification
+   (when (and (featurep 'font-latex)
+             (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("added"        "")
+                               ("changed"      "")
+                               ("deprecated"   "")
+                               ("removed"      "")
+                               ("fixed"        "")
+                               ("security"     "")
+                               ("shortversion" "{"))
+                             'function)))
+ LaTeX-dialect)
+
+(defvar LaTeX-changelog-package-options nil
+  "Package options for the changelog package.")
+
+;;; changelog.el ends here

commit 2c232474a6406fa7683ffaa70406757904423a46
Author: Arash Esbati <address@hidden>
Date:   Thu Aug 22 23:30:33 2019 +0200

    Support explicitly numbered group contructs
    
    * latex.el (LaTeX-extract-key-value-label): Add an optional
    argument for explicitly numbered group contructs.

diff --git a/latex.el b/latex.el
index 17a4462..602e2df 100644
--- a/latex.el
+++ b/latex.el
@@ -6694,10 +6694,12 @@ functions `TeX-arg-color' (style/color.el) or
              last-optional-rejected))
      ,@body))
 
-(defun LaTeX-extract-key-value-label (&optional key)
+(defun LaTeX-extract-key-value-label (&optional key num)
   "Return a regexp string to match a label in an optional argument.
 The optional KEY is a string which is the name of the key in the
-key=value, default is \"label\".
+key=value, default is \"label\".  NUM is an integer for an
+explicitly numbered group construct, useful when adding items to
+`reftex-label-regexps'.
 
 As an extra feature, the key can be the symbol none where the
 entire matching for the key=value is skipped.  The regexp then is
@@ -6723,6 +6725,9 @@ wrapped in \\(?:...\\)? then."
             "[[:space:]]*=[[:space:]]*"
             ;; Match the value; braces around the value are optional
             "{?\\("
+            ;; Cater for NUM which sets the regexp group
+            (when (and num (integerp num))
+              (concat "?" (number-to-string num) ":"))
             ;; One of these chars terminates the value
             "[^] ,}\r\n\t%]+"
             ;; Close the group

commit c64d8c1f1e32181c4c99bf810ac82c7e2a7ababb
Author: Arash Esbati <address@hidden>
Date:   Thu Aug 22 23:27:30 2019 +0200

    * doc/changes.texi: Mention fontification improvement for biblatex.

diff --git a/doc/changes.texi b/doc/changes.texi
index f99e62d..b1b95e2 100644
--- a/doc/changes.texi
+++ b/doc/changes.texi
@@ -64,6 +64,11 @@ Texinfo mode.  When it is enabled, typing @kbd{@@} will 
invoke
 other TeX modes of @AUCTeX{}.
 
 @item
+Fontification support for @samp{biblatex} package is improved and
+updated to macros provided by package version 3.12.  For qualified
+lists, at least 2 mandatory arguments are fontified.
+
+@item
 Support for column specifiers @samp{w} and @samp{W} provided by
 @samp{array} package is added to @file{array.el}.  The correct counting
 of columns only works when the @samp{align} parameter is enclosed in

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

Summary of changes:
 Makefile.in        |   2 +-
 doc/changes.texi   |   5 ++
 latex.el           |   9 +++-
 style/changelog.el | 154 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 167 insertions(+), 3 deletions(-)
 create mode 100644 style/changelog.el


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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