monnier pushed a commit to branch externals/auctex
in repository elpa.
commit 01b89059f7dacb87bae78e1545560b2f4636314f
Author: Mosè Giordano <[email protected]>
Date: Wed Apr 24 23:34:53 2013 +0200
Add history variables in some style files.
* style/acro.el (LaTeX-acro-acronym-history): New variable.
(LaTeX-arg-acro-acronym): Use it.
* style/acronym.el (LaTeX-acronym-acronym-history): New variable.
(LaTeX-arg-acronym-acronym): Use it.
* style/beamer.el (LaTeX-beamer-frametitle-history): New variable.
("beamer"): Use it.
(TeX-arg-beamer-frametitle): Ditto.
* style/siunitx.el (LaTeX-siunitx-unit-history): New variable.
(LaTeX-arg-siunitx-unit): Use it.
---
ChangeLog | 15 +++++++++++++++
style/acro.el | 6 +++++-
style/acronym.el | 6 +++++-
style/beamer.el | 11 ++++++++---
style/siunitx.el | 6 +++++-
5 files changed, 38 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 2692734..0aa4d00 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2013-04-24 Mos� Giordano <[email protected]>
+
+ * style/acro.el (LaTeX-acro-acronym-history): New variable.
+ (LaTeX-arg-acro-acronym): Use it.
+
+ * style/acronym.el (LaTeX-acronym-acronym-history): New variable.
+ (LaTeX-arg-acronym-acronym): Use it.
+
+ * style/beamer.el (LaTeX-beamer-frametitle-history): New variable.
+ ("beamer"): Use it.
+ (TeX-arg-beamer-frametitle): Ditto.
+
+ * style/siunitx.el (LaTeX-siunitx-unit-history): New variable.
+ (LaTeX-arg-siunitx-unit): Use it.
+
2013-04-21 Mos� Giordano <[email protected]>
* style/beamer.el ("beamer"): Set `frame' as default environment.
diff --git a/style/acro.el b/style/acro.el
index d41a9a1..93eb32f 100644
--- a/style/acro.el
+++ b/style/acro.el
@@ -104,6 +104,9 @@ set to `true'."
(add-hook 'TeX-auto-prepare-hook 'LaTeX-acro-prepare)
(add-hook 'TeX-auto-cleanup-hook 'LaTeX-acro-cleanup)
+(defvar LaTeX-acro-acronym-history nil
+ "History of acronyms in acro.")
+
(defun LaTeX-arg-acro-acronym (optional &optional prompt definition)
"Prompt for an acronym completing with known acronyms.
If OPTIONAL is non-nil, insert the resulting value as an optional
@@ -111,7 +114,8 @@ argument, otherwise as a mandatory one. Use PROMPT as the
prompt
string. If DEFINITION is non-nil, add the chosen acronym to the
list of defined acronyms."
(let ((acronym (completing-read (TeX-argument-prompt optional prompt
"Acronym")
- (LaTeX-acro-acronym-list))))
+ (LaTeX-acro-acronym-list) nil nil nil
+ 'LaTeX-acro-acronym-history)))
(if (and definition (not (string-equal "" acronym)))
(LaTeX-add-acro-acronyms acronym))
(TeX-argument-insert acronym optional optional)))
diff --git a/style/acronym.el b/style/acronym.el
index 3bffd70..11295d1 100644
--- a/style/acronym.el
+++ b/style/acronym.el
@@ -53,6 +53,9 @@
(add-hook 'TeX-auto-prepare-hook 'LaTeX-acronym-prepare)
(add-hook 'TeX-auto-cleanup-hook 'LaTeX-acronym-cleanup)
+(defvar LaTeX-acronym-acronym-history nil
+ "History of acronyms in acronym.")
+
;; The former `acronym' stands for package name, the latter stands for the
;; argument of the macro calling this function.
(defun LaTeX-arg-acronym-acronym (optional &optional prompt definition)
@@ -62,7 +65,8 @@ argument, otherwise as a mandatory one. Use PROMPT as the
prompt
string. If DEFINITION is non-nil, add the chosen acronym to the
list of defined acronyms."
(let ((acronym (completing-read (TeX-argument-prompt optional prompt
"Acronym")
- (LaTeX-acronym-list))))
+ (LaTeX-acronym-list) nil nil nil
+ 'LaTeX-acronym-acronym-history)))
(if (and definition (not (string-equal "" acronym)))
(LaTeX-add-acronyms acronym))
(TeX-argument-insert acronym optional optional)))
diff --git a/style/beamer.el b/style/beamer.el
index fdd2293..d41c553 100644
--- a/style/beamer.el
+++ b/style/beamer.el
@@ -51,6 +51,9 @@
(goto-char end-of-begin)
(insert "[fragile]")))))))
+(defvar LaTeX-beamer-frametitle-history nil
+ "History of frame titles in beamer.")
+
(TeX-add-style-hook
"beamer"
(lambda ()
@@ -83,7 +86,8 @@
'("beamerreturnbutton" 1)
'("beamerskipbutton" 1)
'("frame" TeX-arg-beamer-frametitle)
- '("frametitle" 1)
+ '("frametitle"
+ (TeX-arg-eval read-string "Title: " nil
'LaTeX-beamer-frametitle-history))
'("hyperlink" TeX-arg-beamer-overlay-spec 2)
'("hyperlinkslideprev" TeX-arg-beamer-overlay-spec 1)
'("hyperlinkslidenext" TeX-arg-beamer-overlay-spec 1)
@@ -132,7 +136,8 @@
"columnsonlytextwidth"
'("exampleblock" 1)
'("frame" (lambda (env &rest ignore)
- (let ((title (read-string "(Optional) Title: ")))
+ (let ((title (read-string "(Optional) Title: " nil
+ 'LaTeX-beamer-frametitle-history)))
(LaTeX-insert-environment env)
(unless (zerop (length title))
(save-excursion
@@ -193,7 +198,7 @@
(defun TeX-arg-beamer-frametitle (optional &optional prompt)
"Prompt for the frametitle."
- (let ((title (read-string "Title: ")))
+ (let ((title (read-string "Title: " nil 'LaTeX-beamer-frametitle-history)))
(if (not (zerop (length title)))
(insert TeX-grop TeX-esc "frametitle" TeX-grop
title TeX-grcl TeX-grcl)
diff --git a/style/siunitx.el b/style/siunitx.el
index 230c62e..10608a8 100644
--- a/style/siunitx.el
+++ b/style/siunitx.el
@@ -57,6 +57,9 @@
(add-hook 'TeX-auto-prepare-hook 'LaTeX-siunitx-prepare)
(add-hook 'TeX-auto-cleanup-hook 'LaTeX-siunitx-cleanup)
+(defvar LaTeX-siunitx-unit-history nil
+ "History of units in siunitx.")
+
(defun LaTeX-arg-siunitx-unit (optional &optional prompt initial-input
definition)
"Prompt for siunitx units, prefixes, powers, and qualifiers.
If OPTIONAL is non-nil, insert the resulting value as an optional
@@ -77,7 +80,8 @@ non-nil, add the chosen unit to the list of defined units."
(unit (mapconcat 'identity
(TeX-completing-read-multiple
(TeX-argument-prompt optional prompt "Unit")
- (LaTeX-siunitx-unit-list) nil nil initial-input)
+ (LaTeX-siunitx-unit-list) nil nil initial-input
+ 'LaTeX-siunitx-unit-history)
crm-separator)))
(if (and definition (not (string-equal "" unit)))
(LaTeX-add-siunitx-units unit))