[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-diffs] GNU AUCTeX branch, master, updated. ba7755d1b778b21e5e6e1
From: |
Mosè Giordano |
Subject: |
[AUCTeX-diffs] GNU AUCTeX branch, master, updated. ba7755d1b778b21e5e6e1723bd38bcbec0acf6de |
Date: |
Sun, 24 Jan 2016 22:35:13 +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 ba7755d1b778b21e5e6e1723bd38bcbec0acf6de (commit)
via f72d2a9686aca89d26e13d15048be59554c4965e (commit)
via 58386b9b16a17a486342cb272f46acbee44af5de (commit)
via 09cc5d1e170e4a7f85bcacd93b22526e4c425cf1 (commit)
from 255efa3860d3ae164e5c26482d8c143c91c3c7e5 (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 ba7755d1b778b21e5e6e1723bd38bcbec0acf6de
Author: Arash Esbati <address@hidden>
Date: Sat Jan 23 17:20:49 2016 +0100
Improve style/enumitem
* style/enumitem.el (LaTeX-enumitem-newlist-list)
(LaTeX-enumitem-newlist-list-item-arg)
(LaTeX-auto-enumitem-newlist): Remove variables.
(LaTeX-enumitem-newlist-list-local): Fix docstring.
(LaTeX-enumitem-auto-cleanup): Plug \newlist into AUCTeX parser.
("enumitem"): Offer only enumerated environments as completion for
\restartlist.
Signed-off-by: Mosè Giordano <address@hidden>
diff --git a/style/enumitem.el b/style/enumitem.el
index a527c86..bbbfe79 100644
--- a/style/enumitem.el
+++ b/style/enumitem.el
@@ -100,25 +100,14 @@
"Buffer-local key=value options for enumitem macros and environments.")
(make-variable-buffer-local 'LaTeX-enumitem-key-val-options-local)
-;; Variables needed for \newlist: This command is not hooked into
-;; the parser via `TeX-auto-add-type', we mimic that behaviour.
-
-(defvar LaTeX-enumitem-newlist-list nil
- "List of environments defined by command `\\newlist' from
-`enumitem' package.")
-
(defvar LaTeX-enumitem-newlist-list-local nil
- "Local list of all environments definded with `\\newlist'
-plus available through `enumitem' package.")
+ "Local list of all environments definded with `\\newlist' plus
+the ones initially available through `enumitem' package.")
(make-variable-buffer-local 'LaTeX-enumitem-newlist-list-local)
-(defvar LaTeX-enumitem-newlist-list-item-arg nil
- "List of description like environments defined by command
-`\\newlist' from `enumitem' package.")
+;; Setup for \newlist:
-(defvar LaTeX-auto-enumitem-newlist nil
- "Temporary for parsing the arguments of `\\newlist' from
-`enumitem' package.")
+(TeX-auto-add-type "enumitem-newlist" "LaTeX")
(defvar LaTeX-enumitem-newlist-regexp
'("\\\\newlist{\\([^}]+\\)}{\\([^}]+\\)}"
@@ -126,7 +115,6 @@ plus available through `enumitem' package.")
"Matches the arguments of `\\newlist' from `enumitem'
package.")
-
;; Setup for \SetEnumitemKey:
(TeX-auto-add-type "enumitem-SetEnumitemKey" "LaTeX")
@@ -137,7 +125,6 @@ package.")
"Matches the arguments of `\\SetEnumitemKey' from `enumitem'
package.")
-
;; Setup for \SetEnumitemValue:
(TeX-auto-add-type "enumitem-SetEnumitemValue" "LaTeX")
@@ -158,9 +145,7 @@ package.")
;; Plug them into the machinery.
(defun LaTeX-enumitem-auto-prepare ()
"Clear various `LaTeX-enumitem-*' before parsing."
- (setq LaTeX-auto-enumitem-newlist nil
- LaTeX-enumitem-newlist-list nil
- LaTeX-enumitem-newlist-list-item-arg nil
+ (setq LaTeX-auto-enumitem-newlist nil
LaTeX-auto-enumitem-SetEnumitemKey nil
LaTeX-auto-enumitem-SetEnumitemValue nil))
@@ -168,26 +153,19 @@ package.")
"Move parsing results into right places for further usage."
;; \newlist{<name>}{<type>}{<max-depth>}
;; env=<name>, type=<type>, ignored=<max-depth>
- (dolist (env-type LaTeX-auto-enumitem-newlist)
+ (dolist (env-type (LaTeX-enumitem-newlist-list))
(let* ((env (car env-type))
(type (cadr env-type)))
- (add-to-list 'LaTeX-auto-environment
- (list env 'LaTeX-enumitem-env-with-opts))
- (add-to-list 'LaTeX-enumitem-newlist-list
- (list env))
+ (LaTeX-add-environments (list env 'LaTeX-enumitem-env-with-opts))
+ ;; Tell AUCTeX about parsed description like environments.
(when (or (string-equal type "description")
(string-equal type "description*"))
- (add-to-list 'LaTeX-enumitem-newlist-list-item-arg
- (list env)))))
+ (add-to-list 'LaTeX-item-list `(,env . LaTeX-item-argument)))))
;; Now add the parsed env's to the local list.
- (when LaTeX-enumitem-newlist-list
+ (when (LaTeX-enumitem-newlist-list)
(setq LaTeX-enumitem-newlist-list-local
- (append LaTeX-enumitem-newlist-list
- LaTeX-enumitem-newlist-list-local)))
- ;; Tell AUCTeX about parsed description like environments.
- (when LaTeX-enumitem-newlist-list-item-arg
- (dolist (env LaTeX-enumitem-newlist-list-item-arg)
- (add-to-list 'LaTeX-item-list `(,(car env) . LaTeX-item-argument)))))
+ (append (mapcar 'list (mapcar 'car (LaTeX-enumitem-newlist-list)))
+ LaTeX-enumitem-newlist-list-local))))
(add-hook 'TeX-auto-prepare-hook #'LaTeX-enumitem-auto-prepare t)
(add-hook 'TeX-auto-cleanup-hook #'LaTeX-enumitem-auto-cleanup t)
@@ -282,7 +260,6 @@ in `enumitem'-completions."
(pushnew (list key (list val)) opts :test #'equal))
(setq LaTeX-enumitem-key-val-options-local (copy-alist opts)))))
-
(TeX-add-style-hook
"enumitem"
(lambda ()
@@ -347,6 +324,7 @@ in `enumitem'-completions."
(string-equal type "description*"))
(add-to-list 'LaTeX-item-list `(,name . LaTeX-item-argument)))
(LaTeX-add-environments `(,name LaTeX-enumitem-env-with-opts))
+ (LaTeX-add-enumitem-newlists (list name type))
(insert (format "{%s}" name)
(format "{%s}" type))
(format "%s" depth)))))
@@ -396,12 +374,23 @@ in `enumitem'-completions."
'("AddEnumerateCounter" 3)
'("AddEnumerateCounter*" 3)
- ;; This command only makes sense for enumerate type environments.
- ;; Currently, we offer all defined env's -- to be improved
- ;; sometimes.
+ ;; "\restartlist" only works for lists defined with "resume" key.
+ ;; We will not extract that information and leave that to users.
+ ;; For completion, extract enumerated environments from
+ ;; `LaTeX-enumitem-newlist-list' and add "enumerate" to them.
'("restartlist"
- (TeX-arg-eval completing-read "List name: "
- LaTeX-enumitem-newlist-list-local))
+ (TeX-arg-eval
+ (lambda ()
+ (let ((enums '("enumerate")))
+ (when (LaTeX-provided-package-options-member "enumitem" "inline")
+ (pushnew "enumerate*" enums :test #'equal))
+ (dolist (env-type (LaTeX-enumitem-newlist-list))
+ (let ((env (car env-type))
+ (type (cadr env-type)))
+ (when (or (string-equal type "enumerate")
+ (string-equal type "enumerate*"))
+ (pushnew env enums :test #'equal))))
+ (completing-read "List name: " enums)))))
;; "Key" will be parsed and added to key-val list.
'("SetEnumitemKey" LaTeX-arg-SetEnumitemKey)
commit f72d2a9686aca89d26e13d15048be59554c4965e
Author: Arash Esbati <address@hidden>
Date: Sat Jan 23 17:09:58 2016 +0100
Improve font related queries
* style/theorem.el (LaTeX-theorem-fontdecl): Do not prefix the
elements with `TeX-esc'.
(LaTeX-arg-theorem-fontdecl): New function.
("theorem"): Use `LaTeX-arg-theorem-fontdecl' for font related
queries.
Signed-off-by: Mosè Giordano <address@hidden>
diff --git a/style/theorem.el b/style/theorem.el
index 7d8bffd..d8466f1 100644
--- a/style/theorem.el
+++ b/style/theorem.el
@@ -42,21 +42,34 @@
"List of theorem styles provided by `theorem.sty'.")
(defvar LaTeX-theorem-fontdecl
- (mapcar (lambda (elt) (concat TeX-esc elt))
- '(;; family
- "rmfamily" "sffamily" "ttfamily"
- ;; series
- "mdseries" "bfseries"
- ;; shape
- "upshape" "itshape" "slshape" "scshape"
- ;; size
- "tiny" "scriptsize" "footnotesize"
- "small" "normalsize" "large"
- "Large" "LARGE" "huge" "Huge"
- ;; reset macro
- "normalfont"))
+ '(;; family
+ "rmfamily" "sffamily" "ttfamily"
+ ;; series
+ "mdseries" "bfseries"
+ ;; shape
+ "upshape" "itshape" "slshape" "scshape"
+ ;; size
+ "tiny" "scriptsize" "footnotesize"
+ "small" "normalsize" "large"
+ "Large" "LARGE" "huge" "Huge"
+ ;; reset macro
+ "normalfont")
"List of font declaration commands for \"\\theorem(body\|header)font\".")
+(defun LaTeX-arg-theorem-fontdecl (optional &optional prompt)
+ "Prompt for font declaration commands in \"\\theorem(body\|header)font\".
+If OPTIONAL is non-nil, insert the resulting value as an optional
+argument. Use PROMPT as the prompt string."
+ ;; `INITIAL-INPUT' (5th argument to `TeX-completing-read-multiple')
+ ;; is hard-coded to `TeX-esc'.
+ (let* ((crm-separator (regexp-quote TeX-esc))
+ (fontdecl (mapconcat 'identity
+ (TeX-completing-read-multiple
+ (TeX-argument-prompt optional prompt "Font")
+ LaTeX-theorem-fontdecl nil nil TeX-esc)
+ TeX-esc)))
+ (TeX-argument-insert fontdecl optional)))
+
(defun LaTeX-theorem-env-label (environment)
"Insert ENVIRONMENT, query for an optional argument and prompt
for label. AUCTeX users should add ENVIRONMENT to
@@ -133,16 +146,10 @@ make them available as new environments."
LaTeX-theorem-theoremstyle-list))
'("theorembodyfont"
- (TeX-arg-eval mapconcat 'identity
- (TeX-completing-read-multiple
- "Body font: "
- LaTeX-theorem-fontdecl) ""))
+ (LaTeX-arg-theorem-fontdecl "Body font"))
'("theoremheaderfont"
- (TeX-arg-eval mapconcat 'identity
- (TeX-completing-read-multiple
- "Header font: "
- LaTeX-theorem-fontdecl) ""))
+ (LaTeX-arg-theorem-fontdecl "Header font"))
'("theorempreskipamount"
(TeX-arg-length "Skip before theorem"))
commit 58386b9b16a17a486342cb272f46acbee44af5de
Author: Arash Esbati <address@hidden>
Date: Sat Jan 23 17:07:52 2016 +0100
Improve font related queries
* style/ntheorem.el (LaTeX-ntheorem-fontdecl): Do not prefix the
elements with `TeX-esc'.
(LaTeX-arg-ntheorem-fontdecl): New function.
("ntheorem"): Use `LaTeX-arg-ntheorem-fontdecl' for font related
queries.
Signed-off-by: Mosè Giordano <address@hidden>
diff --git a/style/ntheorem.el b/style/ntheorem.el
index cedc5a8..630c09b 100644
--- a/style/ntheorem.el
+++ b/style/ntheorem.el
@@ -49,21 +49,34 @@ defined with \"\\newtheoremstyle\".")
defined with \"\\newtheoremlisttype\".")
(defvar LaTeX-ntheorem-fontdecl
- (mapcar (lambda (elt) (concat TeX-esc elt))
- '(;; family
- "rmfamily" "sffamily" "ttfamily"
- ;; series
- "mdseries" "bfseries"
- ;; shape
- "upshape" "itshape" "slshape" "scshape"
- ;; size
- "tiny" "scriptsize" "footnotesize"
- "small" "normalsize" "large"
- "Large" "LARGE" "huge" "Huge"
- ;; reset macro
- "normalfont"))
+ '(;; family
+ "rmfamily" "sffamily" "ttfamily"
+ ;; series
+ "mdseries" "bfseries"
+ ;; shape
+ "upshape" "itshape" "slshape" "scshape"
+ ;; size
+ "tiny" "scriptsize" "footnotesize"
+ "small" "normalsize" "large"
+ "Large" "LARGE" "huge" "Huge"
+ ;; reset macro
+ "normalfont")
"List of font declaration commands for \"\\newtheoremstyle\".")
+(defun LaTeX-arg-ntheorem-fontdecl (optional &optional prompt)
+ "Prompt for font declaration commands in \"\\theorem(body\|header)font\".
+If OPTIONAL is non-nil, insert the resulting value as an optional
+argument. Use PROMPT as the prompt string."
+ ;; `INITIAL-INPUT' (5th argument to `TeX-completing-read-multiple')
+ ;; is hard-coded to `TeX-esc'.
+ (let* ((crm-separator (regexp-quote TeX-esc))
+ (fontdecl (mapconcat 'identity
+ (TeX-completing-read-multiple
+ (TeX-argument-prompt optional prompt "Font
declaration")
+ LaTeX-ntheorem-fontdecl nil nil TeX-esc)
+ TeX-esc)))
+ (TeX-argument-insert fontdecl optional)))
+
(defun LaTeX-ntheorem-env-label (environment)
"Insert ENVIRONMENT, query for an optional argument and prompt
for label. AUCTeX users should add ENVIRONMENT to
@@ -190,16 +203,10 @@ make them available as new environments. Update
LaTeX-ntheorem-theoremstyle-list))
'("theorembodyfont"
- (TeX-arg-eval mapconcat 'identity
- (TeX-completing-read-multiple
- "Body font: "
- LaTeX-ntheorem-fontdecl) ""))
+ (LaTeX-arg-ntheorem-fontdecl "Body font"))
'("theoremheaderfont"
- (TeX-arg-eval mapconcat 'identity
- (TeX-completing-read-multiple
- "Header font: "
- LaTeX-ntheorem-fontdecl) ""))
+ (LaTeX-arg-ntheorem-fontdecl "Header font"))
'("theoremnumbering"
(TeX-arg-eval completing-read
commit 09cc5d1e170e4a7f85bcacd93b22526e4c425cf1
Author: Arash Esbati <address@hidden>
Date: Sat Jan 23 17:05:12 2016 +0100
Improve font related queries
* style/amsthm.el (LaTeX-amsthm-fontdecl): Do not prefix the
elements with `TeX-esc'.
(LaTeX-arg-amsthm-fontdecl): New function.
("amsthm"): Use `LaTeX-arg-amsthm-fontdecl' for font related
queries.
Signed-off-by: Mosè Giordano <address@hidden>
diff --git a/style/amsthm.el b/style/amsthm.el
index a01cfe3..5c83724 100644
--- a/style/amsthm.el
+++ b/style/amsthm.el
@@ -40,21 +40,34 @@
defined with \"\\newtheoremstyle\".")
(defvar LaTeX-amsthm-fontdecl
- (mapcar (lambda (elt) (concat TeX-esc elt))
- '(;; family
- "rmfamily" "sffamily" "ttfamily"
- ;; series
- "mdseries" "bfseries"
- ;; shape
- "upshape" "itshape" "slshape" "scshape"
- ;; size
- "tiny" "scriptsize" "footnotesize"
- "small" "normalsize" "large"
- "Large" "LARGE" "huge" "Huge"
- ;; reset macro
- "normalfont"))
+ '(;; family
+ "rmfamily" "sffamily" "ttfamily"
+ ;; series
+ "mdseries" "bfseries"
+ ;; shape
+ "upshape" "itshape" "slshape" "scshape"
+ ;; size
+ "tiny" "scriptsize" "footnotesize"
+ "small" "normalsize" "large"
+ "Large" "LARGE" "huge" "Huge"
+ ;; reset macro
+ "normalfont")
"List of font declaration commands for \"\\newtheoremstyle\".")
+(defun LaTeX-arg-amsthm-fontdecl (optional &optional prompt)
+ "Prompt for font declaration commands in \"\\newtheoremstyle\".
+If OPTIONAL is non-nil, insert the resulting value as an optional
+argument. Use PROMPT as the prompt string."
+ ;; `INITIAL-INPUT' (5th argument to `TeX-completing-read-multiple')
+ ;; is hard-coded to `TeX-esc'.
+ (let* ((crm-separator (regexp-quote TeX-esc))
+ (fontdecl (mapconcat 'identity
+ (TeX-completing-read-multiple
+ (TeX-argument-prompt optional prompt "Font")
+ LaTeX-amsthm-fontdecl nil nil TeX-esc)
+ TeX-esc)))
+ (TeX-argument-insert fontdecl optional)))
+
(defun LaTeX-amsthm-env-label (environment)
"Insert ENVIRONMENT, query for an optional argument and prompt
for label. AUCTeX users should add ENVIRONMENT to
@@ -161,16 +174,9 @@ make them available as new environments. Update
(format "%s" nthmstyle))))
(TeX-arg-length "Space above")
(TeX-arg-length "Space below")
- (TeX-arg-eval mapconcat 'identity
- (TeX-completing-read-multiple
- "Body font: "
- LaTeX-amsthm-fontdecl) "")
+ (LaTeX-arg-amsthm-fontdecl "Body font")
"Indent amount"
- (TeX-arg-eval mapconcat 'identity
- (TeX-completing-read-multiple
- "Theorem head font: "
- LaTeX-amsthm-fontdecl) "")
-
+ (LaTeX-arg-amsthm-fontdecl "Theorem head font")
"Punctuation after head"
(TeX-arg-length "Space after head")
"Theorem head spec"))
-----------------------------------------------------------------------
Summary of changes:
style/amsthm.el | 50 +++++++++++++++++++++-----------------
style/enumitem.el | 69 ++++++++++++++++++++++------------------------------
style/ntheorem.el | 49 +++++++++++++++++++++----------------
style/theorem.el | 49 +++++++++++++++++++++----------------
4 files changed, 113 insertions(+), 104 deletions(-)
hooks/post-receive
--
GNU AUCTeX
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [AUCTeX-diffs] GNU AUCTeX branch, master, updated. ba7755d1b778b21e5e6e1723bd38bcbec0acf6de,
Mosè Giordano <=