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. 056d8c84edcdf20a3b365


From: Mosè Giordano
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 056d8c84edcdf20a3b365516f4d5c2dc4a554fda
Date: Sun, 14 Feb 2016 00:46:01 +0000

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  056d8c84edcdf20a3b365516f4d5c2dc4a554fda (commit)
       via  550e05891f494b68af3a57381bd67dbdc0cd2052 (commit)
       via  c09c40589cda2e9859b400932e52e55445a98529 (commit)
       via  af1ee52a86509d81f3a25f9f880bdedb8ec9704d (commit)
      from  e4cad1c2af81715a4bfb18d9338886e040fc49c2 (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 056d8c84edcdf20a3b365516f4d5c2dc4a554fda
Author: Mosè Giordano <address@hidden>
Date:   Sun Feb 14 01:44:52 2016 +0100

    Fix TeX-check-files
    
    * tex-buf.el (TeX-check-files): Run the test in `TeX-master-directory'
      as well.

diff --git a/tex-buf.el b/tex-buf.el
index 3ba1f87..f55d6f4 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -571,7 +571,16 @@ ORIGINALS which are modified but not saved yet."
         (buffers (buffer-list)))
     (dolist (path (mapcar (lambda (dir)
                            (expand-file-name (file-name-as-directory dir)))
-                         TeX-check-path))
+                         (append
+                          TeX-check-path
+                          ;; In `TeX-command-default', this function is used to
+                          ;; check whether bibliography databases are newer
+                          ;; than generated *.bbl files, but bibliography
+                          ;; database are relative to `TeX-master-directory'
+                          ;; and the test can be run also from included files
+                          ;; that are in directories different from
+                          ;; `TeX-master-directory'.
+                          (list (TeX-master-directory)))))
       (dolist (orig originals)
        (dolist (ext extensions)
          (let ((filepath (concat path orig "." ext)))

commit 550e05891f494b68af3a57381bd67dbdc0cd2052
Author: Arash Esbati <address@hidden>
Date:   Sat Feb 13 19:52:46 2016 +0100

    Add new style/splitidx.el
    
    * Makefile.in (STYLESRC): Add new style.
    
    * tex-style.el (LaTeX-splitidx-sindex-reftex-quick-id-key): Add
    customizable variable.
    
    * style/splitidx.el: New file.
    
    Signed-off-by: Mosè Giordano <address@hidden>

diff --git a/Makefile.in b/Makefile.in
index ffe6d76..471ff21 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -153,7 +153,8 @@ STYLESRC = style/prosper.el \
           style/vwcol.el     style/textpos.el   style/transparent.el \
           style/fontenc.el   style/Alegreya.el  style/gloss-italian.el \
           style/newfloat.el  style/subcaption.el style/AlegreyaSans.el \
-          style/hologo.el    style/theorem.el   style/ntheorem.el
+          style/hologo.el    style/theorem.el   style/ntheorem.el \
+          style/splitidx.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/style/splitidx.el b/style/splitidx.el
new file mode 100644
index 0000000..e299b5a
--- /dev/null
+++ b/style/splitidx.el
@@ -0,0 +1,309 @@
+;;; splitidx.el --- AUCTeX style for `splitidx.sty' (v1.2a)
+
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <esbati'at'gmx.de>
+;; Maintainer: address@hidden
+;; Created: 2015-09-19
+;; 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 `splitidx.sty' (v1.2a) from 2013/04/09.
+;; `splitidx.sty' is part of TeXLive.
+
+;; The main index macro provided by `splitidx.sty' is
+;;
+;;     \sindex[<shortcut>]{<index-entry>}
+;;
+;; where <shortcut> identifies the target where <index-entry> is going
+;; into.  This style checks if RefTeX is loaded and adds "\sindex" to
+;; index macros known by RefTeX; this is described in RefTeX manual
+;; section 5.5 Defining Index Macros:
+;;
+;;     (setq reftex-index-macros '(("\\sindex[]{*}" 1 ?s "" nil t)))
+;;
+;; To make things more user friendly, this style does not hard-code
+;; the key `?s' and offers a customizable variable called
+;; `LaTeX-splitidx-sindex-reftex-quick-id-key'.  Customize this
+;; variable to another unique key if you have other preference.  Also
+;; note the integer 1 after "\\sindex[]{*}".  This tells RefTeX to
+;; look in first optional argument to find out which index the entry
+;; belongs to.  If omitted, RefTeX puts the index entry into "idx".
+
+;; `splitidx.sty' provides also the option `idxcommands' where a
+;; command with the name of the <shortcut> is defined for each
+;; declared index.  An example from splitidx.pdf:
+;;
+;;     \documentclass{article}
+;;     \usepackage[idxcommands]{splitidx}
+;;
+;;     \newindex[General Index]{idx}       % Name and shortcut of the 1st index
+;;     \newindex[Index of Animals]{ani}    % ... 2nd index
+;;     \newindex[Index of Fruits]{fru}     % ... 3rd index
+;;     \newindex[Index of Vegetables]{veg} % ... 4th index
+;;     ...
+;;
+;; Now four index commands \idx, \ani, \fru and \veg are available.
+;; This style adds these commands to AUCTeX and RefTeX (check function
+;; `LaTeX-splitidx-auto-cleanup').  The only thing missing is adding
+;; these commands to `reftex-index-macros' since the unique keys must
+;; be set by user.  To get full advantage from RefTeX, remember that
+;; ?i, ?I, and ?g are reserved and set something like this in your
+;; init-file:
+;;
+;;     (add-to-list 'reftex-index-macros '("\\idx" "idx" ?x "" nil t))
+;;     (add-to-list 'reftex-index-macros '("\\ani" "ani" ?a "" nil t))
+;;     (add-to-list 'reftex-index-macros '("\\fru" "fru" ?f "" nil t))
+;;     (add-to-list 'reftex-index-macros '("\\veg" "veg" ?v "" nil t))
+;;
+;; Or you can do this in your tex file:
+;;
+;;     %%% Local Variables:
+;;     %%% mode: latex
+;;     %%% TeX-master: t
+;;     %%% eval: (add-to-list 'reftex-index-macros '("\\idx" "idx" ?x "" nil 
t))
+;;     %%% eval: (add-to-list 'reftex-index-macros '("\\ani" "ani" ?a "" nil 
t))
+;;     %%% eval: (add-to-list 'reftex-index-macros '("\\fru" "fru" ?f "" nil 
t))
+;;     %%% eval: (add-to-list 'reftex-index-macros '("\\veg" "veg" ?v "" nil 
t))
+;;     %%% End:
+;;
+
+;;; Code:
+
+;; Needed for auto-parsing.
+(require 'tex)
+
+;; Setup parsing for \newindex:
+(TeX-auto-add-type "splitidx-newindex" "LaTeX" "splitidx-newindices")
+
+(defvar LaTeX-splitidx-newindex-regex
+  `(,(concat "\\\\new\\(?:protected\\)?index"
+            "\\(?:\\[[^}]*\\]\\)?"
+            "{\\([^}]+\\)}")
+    1 LaTeX-auto-splitidx-newindex)
+  "Matches the argument of `\\newindex' from `splitidx.sty'.")
+
+(defun LaTeX-splitidx-auto-prepare ()
+  "Clear `LaTeX-auto-splitidx-newindex' before parsing."
+  (setq LaTeX-auto-splitidx-newindex nil))
+
+(defun LaTeX-splitidx-auto-cleanup ()
+  "Process parsed results for \"splitidx.sty\"."
+  (when (LaTeX-provided-package-options-member "splitidx" "idxcommands")
+    (dolist (elt (mapcar 'car (LaTeX-splitidx-newindex-list)))
+      ;; Make every element available as a command
+      (TeX-add-symbols `(,elt TeX-arg-index))
+      ;; font-locking
+      (when (and (featurep 'font-latex)
+                (eq TeX-install-font-lock 'font-latex-setup))
+       (font-latex-add-keywords `((,elt  "{"))
+                                'reference))
+      ;; Prepare for parsing
+      (add-to-list 'LaTeX-auto-regexp-list
+                  `(,(concat
+                      "\\\\"
+                      elt
+                      "{\\([^}{]*\\({[^}{]*\\({[^}{]*\\({[^}{]*}[^}{]*\\)*"
+                      "}[^}{]*\\)*}[^}{]*\\)*\\)}")
+                    1 LaTeX-auto-index-entry))
+      ;; Cater for completion
+      (add-to-list 'TeX-complete-list
+                  `(,(concat "\\\\" elt "{\\([^{}\n\r]*\\)"
+                    1 LaTeX-index-entry-list "}"))) )))
+
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-splitidx-auto-prepare t)
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-splitidx-auto-cleanup t)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
+(TeX-add-style-hook
+ "splitidx"
+ (lambda ()
+
+   (TeX-add-symbols
+
+    ;; 3.1 Setup
+    '("newindex"
+      [ "Index name" ]
+      (TeX-arg-eval
+       (lambda ()
+        (let ((shortcut (TeX-read-string
+                         (TeX-argument-prompt optional nil "Short cut"))))
+          (LaTeX-add-splitidx-newindices shortcut)
+          (format "%s" shortcut)))))
+
+    ;; 3.2 Marking up index entries
+    '("sindex"
+      ;; I don't use `[ TeX-arg-index-tag ]' here
+      [ TeX-arg-eval completing-read
+                    (TeX-argument-prompt optional nil "Short cut")
+                    (LaTeX-splitidx-newindex-list) ]
+      TeX-arg-index)
+
+    ;; 3.4 Customizing index entries
+    '("AtWriteToIndex"
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Short cut")
+                   (LaTeX-splitidx-newindex-list))
+      t)
+
+    '("AtNextWriteToIndex"
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Short cut")
+                   (LaTeX-splitidx-newindex-list))
+      t)
+
+    ;; 3.6 Preventing premature expansion of index entries
+    '("newprotectedindex"
+      [ "Index name" ]
+      (TeX-arg-eval
+       (lambda ()
+        (let ((shortcut (TeX-read-string
+                         (TeX-argument-prompt optional nil "Short cut"))))
+          (LaTeX-add-splitidx-newindices shortcut)
+          (format "%s" shortcut)))))
+
+    ;; 3.7 Including the generated indices in your document
+    '("printindex"
+      [ TeX-arg-eval completing-read
+                    (TeX-argument-prompt optional nil "Short cut")
+                    (LaTeX-splitidx-newindex-list) ]
+      [ "Index name" ])
+
+    '("printindex*" 0)
+
+    '("printsubindex"
+      [ TeX-arg-eval completing-read
+                    (TeX-argument-prompt optional nil "Short cut")
+                    (LaTeX-splitidx-newindex-list) ]
+      [ "Index name" ])
+
+    '("printsubindex*" 0)
+
+    '("setindexpreamble"
+      [ TeX-arg-eval completing-read
+                    (TeX-argument-prompt optional nil "Short cut")
+                    (LaTeX-splitidx-newindex-list) ]
+      t)
+
+    '("useindexpreamble" [ TeX-arg-macro ])
+
+    '("indexshortcut" 0)
+
+    '("extendtheindex" 4) )
+
+   ;; Add splitidx to the parser.
+   (TeX-auto-add-regexp LaTeX-splitidx-newindex-regex)
+
+   ;; Borrowed from index.el
+   (add-to-list 'LaTeX-auto-regexp-list
+               `(,(concat "\\\\sindex\\(?:\\[[^{}]*\\]\\)?"
+                          "{\\([^}{]*\\({[^}{]*\\({[^}{]*\\({[^}{]*}[^}{]*\\)*"
+                          "}[^}{]*\\)*}[^}{]*\\)*\\)}")
+                 1 LaTeX-auto-index-entry))
+
+   ;; Completion for \sindex entries
+   (add-to-list 'TeX-complete-list
+               '("\\\\sindex\\(\\[[^][{}]*\\]\\)?{\\([^{}\n\r]*\\)"
+                 2 LaTeX-index-entry-list "}"))
+
+   ;; Completion for the |see macro
+   (add-to-list 'TeX-complete-list
+               '("|see{\\([^{}\n\r]*\\)" 1 LaTeX-index-entry-list))
+
+   ;; Append our defintion to `reftex-index-macros' in order not to
+   ;; override any user customizations.
+   (when (boundp 'reftex-index-macros)
+     (add-to-list 'reftex-index-macros
+                 `("\\sindex[]{*}" 1
+                   ,LaTeX-splitidx-sindex-reftex-quick-id-key "" nil t)))
+
+   ;; 3.2 Marking up index entries
+   ;; \index should be an alias for \sindex
+   (when (LaTeX-provided-package-options-member "splitidx" "useindex")
+       (TeX-add-symbols
+       '("index"
+         [TeX-arg-eval completing-read
+                       (TeX-argument-prompt optional nil "Short cut")
+                       (LaTeX-splitidx-newindex-list) ]
+         (TeX-arg-index)))
+       ;; Tell RefTeX to look in the optional arg. for the index short cut
+       (when (boundp 'reftex-index-macros)
+        (add-to-list 'reftex-index-macros
+                     '("\\index[]{*}" 1 ?i "" nil t)
+                     t))
+       (add-to-list 'LaTeX-auto-regexp-list
+                   `(,(concat
+                       "\\\\index\\(?:\\[[^{}]*\\]\\)?"
+                       "{\\([^}{]*\\({[^}{]*\\({[^}{]*\\({[^}{]*}[^}{]*\\)*"
+                       "}[^}{]*\\)*}[^}{]*\\)*\\)}")
+                     1 LaTeX-auto-index-entry))
+       (when (and (featurep 'font-latex)
+                 (eq TeX-install-font-lock 'font-latex-setup))
+        (font-latex-add-keywords '(("index" "[{"))
+                                 'reference)))
+
+   ;; 3.5 Automatic custom index commands
+   ;; With package option `idxcommands', one can write \foo{<entry>}
+   ;; instead of \sindex[foo]{<entry>}
+   (when (and (LaTeX-provided-package-options-member "splitidx" "idxcommands")
+             (LaTeX-splitidx-newindex-list))
+     (dolist (elt (mapcar 'car (LaTeX-splitidx-newindex-list)))
+       ;; Make every `foo' available as a command
+       (TeX-add-symbols `(,elt TeX-arg-index))
+       ;; Cater for font-locking
+       (when (and (featurep 'font-latex)
+                 (eq TeX-install-font-lock 'font-latex-setup))
+        (font-latex-add-keywords `((,elt  "{"))
+                                 'reference))
+       ;; Add defined <entry> to `LaTeX-index-entry-list'
+       (add-to-list 'LaTeX-auto-regexp-list
+                   `(,(concat
+                       "\\\\"
+                       elt
+                       "{\\([^}{]*\\({[^}{]*\\({[^}{]*\\({[^}{]*}[^}{]*\\)*"
+                       "}[^}{]*\\)*}[^}{]*\\)*\\)}")
+                     1 LaTeX-auto-index-entry)) ))
+
+   ;; Fontification
+   (when (and (featurep 'font-latex)
+             (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("newindex"           "[{")
+                               ("AtWriteToIndex"     "{{")
+                               ("AtNextWriteToIndex" "{{")
+                               ("newprotectedindex"  "[{")
+                               ("setindexpreamble"   "[{")
+                               ("useindexpreamble"   "[")
+                               ("extendtheindex"     "{{{{"))
+                             'function)
+     (font-latex-add-keywords '(("sindex"             "[{"))
+                             'reference)))
+ LaTeX-dialect)
+
+(defvar LaTeX-splitidx-package-options
+  '("makeindex"
+    "useindex"
+    "allintoone"
+    "split"
+    "protected"
+    "idxcommands")
+  "Prompt for package options for the splitidx package.")
+
+;;; splitidx.el ends here
diff --git a/tex-style.el b/tex-style.el
index a1ffb97..d25bccc 100644
--- a/tex-style.el
+++ b/tex-style.el
@@ -398,6 +398,18 @@ Inserting the subdirectory in the filename (as
                                         (TeX-master-directory))))
                 (function :tag "other")))
 
+;; style/splitidx.el
+
+(defcustom LaTeX-splitidx-sindex-reftex-quick-id-key ?s
+  "Unique letter identifying \"\\sindex\" macro in RefTeX.
+
+A character argument for quick identification of \"\\sindex\"
+when RefTeX inserts new index entries with `reftex-index'.  It
+must be unique.  It is initialized to ?s when added to
+`reftex-index-macros'."
+  :group 'LaTeX-style
+  :type 'character)
+
 (provide 'tex-style)
 
 ;;; tex-style.el ends here

commit c09c40589cda2e9859b400932e52e55445a98529
Author: Arash Esbati <address@hidden>
Date:   Sat Feb 13 19:48:01 2016 +0100

    Fix wrong usage of `TeX-auto-prepare-hook'
    
    * style/theorem.el (TeX-auto-cleanup-hook):
    * style/ntheorem.el (TeX-auto-cleanup-hook):
    * style/newfloat.el (TeX-auto-cleanup-hook):
    * style/amsthm.el (TeX-auto-cleanup-hook): Use
    `TeX-auto-cleanup-hook' instead of mistakenly used
    `TeX-auto-prepare-hook'.
    
    Signed-off-by: Mosè Giordano <address@hidden>

diff --git a/style/amsthm.el b/style/amsthm.el
index 5c83724..5deb9e3 100644
--- a/style/amsthm.el
+++ b/style/amsthm.el
@@ -119,7 +119,7 @@ make them available as new environments.  Update
                 newthmstyle)))
 
 (add-hook 'TeX-auto-prepare-hook #'LaTeX-amsthm-auto-prepare t)
-(add-hook 'TeX-auto-prepare-hook #'LaTeX-amsthm-auto-cleanup t)
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-amsthm-auto-cleanup t)
 (add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
 
 (TeX-add-style-hook
diff --git a/style/newfloat.el b/style/newfloat.el
index 4cde32e..e84fad7 100644
--- a/style/newfloat.el
+++ b/style/newfloat.el
@@ -134,7 +134,7 @@ If `caption.el' is loaded, add the new floating environment 
to
         (concat "listof" flt "es"))))))
 
 (add-hook 'TeX-auto-prepare-hook #'LaTeX-newfloat-auto-prepare t)
-(add-hook 'TeX-auto-prepare-hook #'LaTeX-newfloat-auto-cleanup t)
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-newfloat-auto-cleanup t)
 (add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
 
 (TeX-add-style-hook
diff --git a/style/ntheorem.el b/style/ntheorem.el
index 630c09b..068f40d 100644
--- a/style/ntheorem.el
+++ b/style/ntheorem.el
@@ -142,7 +142,7 @@ make them available as new environments.  Update
     (TeX-add-symbols (concat nthm "name"))))
 
 (add-hook 'TeX-auto-prepare-hook #'LaTeX-ntheorem-auto-prepare t)
-(add-hook 'TeX-auto-prepare-hook #'LaTeX-ntheorem-auto-cleanup t)
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-ntheorem-auto-cleanup t)
 (add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
 
 (TeX-add-style-hook
diff --git a/style/theorem.el b/style/theorem.el
index d8466f1..8b4101e 100644
--- a/style/theorem.el
+++ b/style/theorem.el
@@ -111,7 +111,7 @@ make them available as new environments."
     (LaTeX-add-environments (list newthm 'LaTeX-theorem-env-label))))
 
 (add-hook 'TeX-auto-prepare-hook #'LaTeX-theorem-auto-prepare t)
-(add-hook 'TeX-auto-prepare-hook #'LaTeX-theorem-auto-cleanup t)
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-theorem-auto-cleanup t)
 (add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
 
 (TeX-add-style-hook

commit af1ee52a86509d81f3a25f9f880bdedb8ec9704d
Author: Arash Esbati <address@hidden>
Date:   Sat Feb 13 19:44:43 2016 +0100

    Add support for missing macro \SetLabelAlign
    
    * style/enumitem.el ("enumitem-SetLabelAlign"): Plug
    \SetLabelAlign into AUCTeX parser.
    (LaTeX-enumitem-SetLabelAlign-regexp): New variable.
    (LaTeX-enumitem-auto-prepare): Reset
    `LaTeX-auto-enumitem-SetLabelAlign'.
    (LaTeX-arg-SetLabelAlign): New function to query the arguments of
    \SetLabelAlign.
    ("enumitem"): Add \SetLabelAlign to style hook incl. fontification.
    (LaTeX-arg-SetEnumitemValue): Use `completing-read' instead of
    `TeX-read-key-val'.
    
    Signed-off-by: Mosè Giordano <address@hidden>

diff --git a/style/enumitem.el b/style/enumitem.el
index bbbfe79..87249bc 100644
--- a/style/enumitem.el
+++ b/style/enumitem.el
@@ -1,6 +1,6 @@
 ;;; enumitem.el --- AUCTeX style for `enumitem.sty' (v3.5.2)
 
-;; Copyright (C) 2015 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2016 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <esbati'at'gmx.de>
 ;; Maintainer: address@hidden
@@ -115,6 +115,16 @@ the ones initially available through `enumitem' package.")
   "Matches the arguments of `\\newlist' from `enumitem'
 package.")
 
+;; Setup for \SetLabelAlign:
+
+(TeX-auto-add-type "enumitem-SetLabelAlign" "LaTeX")
+
+(defvar LaTeX-enumitem-SetLabelAlign-regexp
+  '("\\\\SetLabelAlign{\\([^}]+\\)}"
+    1 LaTeX-auto-enumitem-SetLabelAlign)
+  "Matches the argument of `\\SetLabelAlign' from `enumitem'
+package.")
+
 ;; Setup for \SetEnumitemKey:
 
 (TeX-auto-add-type "enumitem-SetEnumitemKey" "LaTeX")
@@ -146,6 +156,7 @@ package.")
 (defun LaTeX-enumitem-auto-prepare ()
   "Clear various `LaTeX-enumitem-*' before parsing."
   (setq LaTeX-auto-enumitem-newlist          nil
+       LaTeX-auto-enumitem-SetLabelAlign    nil
        LaTeX-auto-enumitem-SetEnumitemKey   nil
        LaTeX-auto-enumitem-SetEnumitemValue nil))
 
@@ -203,6 +214,20 @@ key-val and the first item."
                (current-fill-column)))
     (LaTeX-fill-paragraph nil)))
 
+(defun LaTeX-arg-SetLabelAlign (optional)
+  "Ask for new type (value) for the \"align\" key and add it to
+`LaTeX-enumitem-key-val-options-local'."
+  (LaTeX-enumitem-update-key-val-options)
+  (let* ((key "align")
+        (val (TeX-read-string "Alignment: "))
+        (val-match (cdr (assoc key LaTeX-enumitem-key-val-options-local)))
+        (temp (copy-alist LaTeX-enumitem-key-val-options-local))
+        (opts (assq-delete-all (car (assoc key temp)) temp)))
+    (pushnew (list key (delete-dups (apply 'append (list val) val-match)))
+            opts :test #'equal)
+    (TeX-argument-insert val optional)
+    (LaTeX-add-enumitem-SetLabelAligns val)))
+
 (defun LaTeX-arg-SetEnumitemKey (optional)
   "Ask for a new key to be defined and add it to
 `LaTeX-enumitem-key-val-options-local'."
@@ -225,7 +250,7 @@ key-val and the first item."
   "Ask for a new value added to an existing key incl. the final
 replacement of the value."
   (LaTeX-enumitem-update-key-val-options)
-  (let* ((key (TeX-read-key-val optional LaTeX-enumitem-key-val-options-local 
"Key"))
+  (let* ((key (completing-read  "Key: " LaTeX-enumitem-key-val-options-local))
         (val (TeX-read-string "String value: "))
         ;; (key-match (car (assoc key LaTeX-enumitem-key-val-options-local)))
         (val-match (cdr (assoc key LaTeX-enumitem-key-val-options-local)))
@@ -258,6 +283,15 @@ in `enumitem'-completions."
          (pushnew (list key (delete-dups (apply 'append (list val) val-match)))
                   opts :test #'equal)
        (pushnew (list key (list val)) opts :test #'equal))
+      (setq LaTeX-enumitem-key-val-options-local (copy-alist opts))))
+  (dolist (newalign (LaTeX-enumitem-SetLabelAlign-list))
+    (let* ((key "align")
+          (val (car newalign))
+          (val-match (cdr (assoc key LaTeX-enumitem-key-val-options-local)))
+          (temp (copy-alist LaTeX-enumitem-key-val-options-local))
+          (opts (assq-delete-all (car (assoc key temp)) temp)))
+      (pushnew (list key (delete-dups (apply 'append (list val) val-match)))
+              opts :test #'equal)
       (setq LaTeX-enumitem-key-val-options-local (copy-alist opts)))))
 
 (TeX-add-style-hook
@@ -268,6 +302,7 @@ in `enumitem'-completions."
    (TeX-auto-add-regexp LaTeX-enumitem-newlist-regexp)
    (TeX-auto-add-regexp LaTeX-enumitem-SetEnumitemKey-regexp)
    (TeX-auto-add-regexp LaTeX-enumitem-SetEnumitemValue-regexp)
+   (TeX-auto-add-regexp LaTeX-enumitem-SetLabelAlign-regexp)
 
    ;; Activate the buffer-local version of key-vals.
    (setq LaTeX-enumitem-key-val-options-local
@@ -392,6 +427,9 @@ in `enumitem'-completions."
                 (pushnew env enums :test #'equal))))
           (completing-read "List name: " enums)))))
 
+    ;; "Align" is added as new value to "align" key in key-val list.
+    '("SetLabelAlign" LaTeX-arg-SetLabelAlign t)
+
     ;; "Key" will be parsed and added to key-val list.
     '("SetEnumitemKey" LaTeX-arg-SetEnumitemKey)
 
@@ -413,6 +451,7 @@ in `enumitem'-completions."
                                ("renewlist"           "{{{")
                                ("setlist"             "*[{")
                                ("AddEnumerateCounter" "*{{{")
+                               ("SetLabelAlign"       "{{")
                                ("SetEnumitemKey"      "{{" )
                                ("SetEnumitemValue"    "{{{"))
                              'function)

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

Summary of changes:
 Makefile.in       |    3 +-
 style/amsthm.el   |    2 +-
 style/enumitem.el |   43 +++++++-
 style/newfloat.el |    2 +-
 style/ntheorem.el |    2 +-
 style/splitidx.el |  309 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 style/theorem.el  |    2 +-
 tex-buf.el        |   11 ++-
 tex-style.el      |   12 ++
 9 files changed, 378 insertions(+), 8 deletions(-)
 create mode 100644 style/splitidx.el


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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