[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex af1ee52 47/69: Add support for missing macro \Se
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex af1ee52 47/69: Add support for missing macro \SetLabelAlign |
Date: |
Sat, 26 Mar 2016 21:36:36 +0000 |
branch: externals/auctex
commit af1ee52a86509d81f3a25f9f880bdedb8ec9704d
Author: Arash Esbati <address@hidden>
Commit: Mosè Giordano <address@hidden>
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>
---
style/enumitem.el | 43 +++++++++++++++++++++++++++++++++++++++++--
1 files changed, 41 insertions(+), 2 deletions(-)
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)
- [elpa] externals/auctex 08ae29b 19/69: Merge branch 'master' into simplify-TeX-parse-error, (continued)
- [elpa] externals/auctex 08ae29b 19/69: Merge branch 'master' into simplify-TeX-parse-error, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex 53f2fab 53/69: Another fix for TeX-parse-errro, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex d7f443e 37/69: Add script to update the ChangeLog, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex 8b2550e 16/69: Merge branch 'master' into simplify-TeX-parse-error, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex 2fd59c9 60/69: Improve word-string regexp in TeX-warning, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex 43ba124 23/69: Merge branch 'master' into simplify-TeX-parse-error, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex 1711536 55/69: Fix detection of line number in TeX-warning, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex 2e543ef 58/69: Fix parsing of vertical bad boxes context, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex 30fe0e9 63/69: Ensure LaTeX-indent-environment-list environments aren't filled, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex 2c21439 41/69: Improve parsing of certain warnings, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex af1ee52 47/69: Add support for missing macro \SetLabelAlign,
Tassilo Horn <=
- [elpa] externals/auctex 57147c7 59/69: Another fix for vertical bad box warnings, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex cc59302 51/69: Show and hide warnings and bad boxes in error overview, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex 8fac199 14/69: Merge branch 'master' into simplify-TeX-parse-error, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex a2a919d 61/69: Use TeX-quote-after-quote in all language style files, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex 188e4b1 66/69: Temporarily bind gc-cons-threshold in time-consuming task, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex 2888571 52/69: Allow ignoring certain warnings, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex a33be07 62/69: Remove "table" and "table*" from LaTeX-indent-environment-list, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex e4cad1c 46/69: Add support for Atril viewer, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex 464bef6 39/69: Fix TeX-parse-error, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex 00d9438 45/69: Add support for dviout viewer, Tassilo Horn, 2016/03/26