[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 103/299: Use user-full-name as initial input to author macro.
From: |
Stefan Monnier |
Subject: |
[elpa] 103/299: Use user-full-name as initial input to author macro. |
Date: |
Sun, 02 Nov 2014 03:10:38 +0000 |
monnier pushed a commit to branch externals/auctex
in repository elpa.
commit 81fb5151e46662b72439d3cb039fd44585f102a4
Author: Mosè Giordano <address@hidden>
Date: Tue Apr 16 16:04:52 2013 +0200
Use user-full-name as initial input to author macro.
* latex.el (LaTeX-default-author): New customizable variable.
(LaTeX-arg-author): New function.
(LaTeX-common-initialization): Use `LaTeX-arg-author' for the
\author macro.
* doc/auctex.texi (Adding Macros): Document `LaTeX-arg-author'.
Mention `LaTeX-default-author' option.
---
ChangeLog | 10 ++++++++--
doc/auctex.texi | 5 +++++
latex.el | 21 ++++++++++++++++++++-
3 files changed, 33 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 4409695..5cdc377 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,13 +1,19 @@
2013-04-16 Mos� Giordano <address@hidden>
+ * latex.el (LaTeX-default-author): New customizable variable.
+ (LaTeX-arg-author): New function.
+ (LaTeX-common-initialization): Use `LaTeX-arg-author' for the
+ \author macro.
+
* doc/auctex.texi (Itemize-like): Document `TeX-arg-item-label-p'
option.
(Tabular-like): Document `LaTeX-default-width' option.
(Modes and Hooks): Add modes and hooks to indices.
(Adding Macros): Document `TeX-arg-index-tag', `TeX-arg-index',
`TeX-arg-document', `LaTeX-arg-usepackage', `TeX-arg-bibstyle',
- `TeX-arg-bibliography', `TeX-read-key-val', and `TeX-arg-key-val'
- functions. Mention `TeX-arg-cite-note-p' option.
+ `TeX-arg-bibliography', `LaTeX-arg-author', `TeX-read-key-val',
+ and `TeX-arg-key-val' functions. Mention `TeX-arg-cite-note-p'
+ and `LaTeX-default-author' options.
(Adding Environments): Use in example code actually present in
`listings.el' file.
diff --git a/doc/auctex.texi b/doc/auctex.texi
index 7b8a526..fbf37fb 100644
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -4095,6 +4095,11 @@ Insert width and height as a pair. No arguments.
@item TeX-arg-coordinate
Insert x and y coordinates as a pair. No arguments.
address@hidden LaTeX-arg-author
address@hidden LaTeX-default-author
+Prompt for document author, using @code{LaTeX-default-author} as initial
+input.
+
@item TeX-read-key-val
Prompt for a key=value list of options and return them.
diff --git a/latex.el b/latex.el
index 5bfb5df..d647bba 100644
--- a/latex.el
+++ b/latex.el
@@ -2196,6 +2196,25 @@ string."
TeX-left-right-braces)))
(indent-according-to-mode)))))
+(defcustom LaTeX-default-author user-full-name
+ "Initial input to `LaTeX-arg-author' prompt.
+If nil, do not prompt at all."
+ :group 'LaTeX-macro
+ :type '(choice (const :tag "Do not prompt" nil)
+ string))
+
+(defun LaTeX-arg-author (optional &optional prompt)
+ "Prompt for author name.
+Insert the given value as a TeX macro argument. If OPTIONAL is
+non-nil, insert it as an optional argument. Use PROMPT as the
+prompt string. `LaTeX-default-author' is the initial input."
+ (let ((author (if LaTeX-default-author
+ (read-string
+ (TeX-argument-prompt optional prompt "Author(s)")
+ LaTeX-default-author)
+ "")))
+ (TeX-argument-insert author optional nil)))
+
(defun TeX-read-key-val (optional key-val-alist &optional prompt)
"Prompt for keys and values in KEY-VAL-ALIST and return them.
If OPTIONAL is non-nil, indicate in the prompt that we are
@@ -5557,7 +5576,7 @@ i.e. you do _not_ have to cater for this yourself by
adding \\\\' or $."
'("acute" t) '("grave" t) '("ddot" t) '("tilde" t) '("bar" t)
'("breve" t) '("check" t) '("hat" t) '("vec" t) '("dot" t)
'("widetilde" t) '("widehat" t)
- '("author" t)
+ '("author" LaTeX-arg-author)
'("date" TeX-arg-date)
'("thanks" t)
'("title" t)
- [elpa] 89/299: Fix a bug in font-latex-add-to-syntax-alist., (continued)
- [elpa] 89/299: Fix a bug in font-latex-add-to-syntax-alist., Stefan Monnier, 2014/11/01
- [elpa] 97/299: Replace completing-read-multiple with TeX-completing-read-multiple., Stefan Monnier, 2014/11/01
- [elpa] 98/299: Use crm-separator as separator in XEmacs TeX-completing-read-multiple., Stefan Monnier, 2014/11/01
- [elpa] 99/299: Add prompt argument to TeX-read-key-val and TeX-arg-key-val., Stefan Monnier, 2014/11/01
- [elpa] 101/299: Improve Evince backward search., Stefan Monnier, 2014/11/01
- [elpa] 94/299: Fix 2 bugs in DBUS communication., Stefan Monnier, 2014/11/01
- [elpa] 104/299: Change default value of `LaTeX-default-author' and adapt `LaTeX-arg-author'., Stefan Monnier, 2014/11/01
- [elpa] 96/299: Raise frame on backward search., Stefan Monnier, 2014/11/01
- [elpa] 105/299: Fix plain TeX abbrev table name., Stefan Monnier, 2014/11/01
- [elpa] 102/299: Document some missing functions and options., Stefan Monnier, 2014/11/01
- [elpa] 103/299: Use user-full-name as initial input to author macro.,
Stefan Monnier <=
- [elpa] 100/299: Better unbinding of SPC in LaTeX-arg-acro-key-val and LaTeX-arg-siunitx-unit., Stefan Monnier, 2014/11/01
- [elpa] 106/299: Add beamer class options., Stefan Monnier, 2014/11/01
- [elpa] 95/299: Add new style files acro.el and acronym.el., Stefan Monnier, 2014/11/01
- [elpa] 108/299: Some improvements to amsthm style file., Stefan Monnier, 2014/11/01
- [elpa] 107/299: Add counters and pagestyle to some class styles., Stefan Monnier, 2014/11/01
- [elpa] 110/299: Set default environment for some class styles., Stefan Monnier, 2014/11/01
- [elpa] 113/299: Change BibTeX button to Biber when LaTeX-using-biber is non-nil., Stefan Monnier, 2014/11/01
- [elpa] 112/299: Add new variable `LaTeX-default-document-environment'., Stefan Monnier, 2014/11/01
- [elpa] 111/299: Add history variables in some style files., Stefan Monnier, 2014/11/01
- [elpa] 115/299: Document LaTeX-default-document-environment., Stefan Monnier, 2014/11/01