monnier pushed a commit to branch externals/auctex
in repository elpa.
commit a54ce4d34d85338d9484b21d62024696705fe70f
Author: Mosè Giordano <[email protected]>
Date: Fri Jul 25 00:00:18 2014 +0200
Add customizable option for default date format.
* doc/auctex.texi (Adding Macros): Document `TeX-date-format'.
* doc/changes.texi: Mention `TeX-date-format'.
* latex.el (TeX-date-format): New customizable option.
Suggested by Uwe Brauer.
(TeX-arg-date): Use it.
---
ChangeLog | 10 ++++++++++
doc/auctex.texi | 7 ++++++-
doc/changes.texi | 2 +-
latex.el | 7 ++++++-
4 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index fb1e62f..40324e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2014-07-25 Mos� Giordano <[email protected]>
+
+ * doc/auctex.texi (Adding Macros): Document `TeX-date-format'.
+
+ * doc/changes.texi: Mention `TeX-date-format'.
+
+ * latex.el (TeX-date-format): New customizable option.
+ Suggested by Uwe Brauer.
+ (TeX-arg-date): Use it.
+
2014-07-17 Mos� Giordano <[email protected]>
* Makefile.in: Update copyright years.
diff --git a/doc/auctex.texi b/doc/auctex.texi
index 3961bb8..7261705 100644
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -4394,7 +4394,12 @@ Prompt for a @LaTeX{} length completing with known
lengths.
Prompt for a @TeX{} macro with completion.
@item TeX-arg-date
-Prompt for a date, defaulting to the current date.
+@vindex TeX-date-format
+Prompt for a date, defaulting to the current date. The format of the
+date is specified by the @code{TeX-date-format} option. If you want to
+change the format when the @samp{babel} package is loaded with a
+specific language, set @code{TeX-date-format} inside the appropriate
+language hook, for details @pxref{European}.
@item TeX-arg-version
Prompt for the version of a file, using as initial input the current
diff --git a/doc/changes.texi b/doc/changes.texi
index 5707cd0..b408b47 100644
--- a/doc/changes.texi
+++ b/doc/changes.texi
@@ -53,7 +53,7 @@ non-nil. Completion for class options of the standard
@LaTeX{} classes
is provided as well.
@item
-New user options @code{LaTeX-default-author},
+New user options @code{LaTeX-default-author}, @code{TeX-date-format},
@code{TeX-insert-braces-alist}, @code{LaTeX-fontspec-arg-font-search},
and @code{LaTeX-fontspec-font-list-default}. A new possible value
(@code{show-all-optional-args}) for
diff --git a/latex.el b/latex.el
index d9a383f..89be909 100644
--- a/latex.el
+++ b/latex.el
@@ -2251,12 +2251,17 @@ string."
nil t)
optional))
+(defcustom TeX-date-format "%Y/%m/%d"
+ "The default date format prompted by `TeX-arg-date'."
+ :group 'LaTeX-macro
+ :type 'string)
+
(defun TeX-arg-date (optional &optional prompt)
"Prompt for a date, defaulting to the current date.
If OPTIONAL is non-nil, insert the resulting value as an optional
argument, otherwise as a mandatory one. Use PROMPT as the prompt
string."
- (let ((default (format-time-string "%Y/%m/%d" (current-time))))
+ (let ((default (format-time-string TeX-date-format (current-time))))
(TeX-argument-insert
(TeX-read-string (TeX-argument-prompt
optional prompt (format "Date (default %s)" default))