[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex e1ec6a0 33/36: Make second argument of LaTeX-lab
From: |
Stefan Monnier |
Subject: |
[elpa] externals/auctex e1ec6a0 33/36: Make second argument of LaTeX-label optional. |
Date: |
Fri, 28 Nov 2014 17:25:53 +0000 |
branch: externals/auctex
commit e1ec6a022a7cc03c6978f5401486334bb21ac94a
Author: Mosè Giordano <address@hidden>
Date: Thu Nov 27 19:16:03 2014 +0100
Make second argument of LaTeX-label optional.
* latex.el (LaTeX-label-alist): Expand doc string.
(LaTeX-label): Make second argument optional to restore backward
compatibility and update doc string accordingly. (Bug#19178)
---
ChangeLog | 6 ++++++
latex.el | 27 ++++++++++++++++++++++-----
2 files changed, 28 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ddb7513..6f450ba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-11-27 Mos� Giordano <address@hidden>
+
+ * latex.el (LaTeX-label-alist): Expand doc string.
+ (LaTeX-label): Make second argument optional to restore backward
+ compatibility and update doc string accordingly. (Bug#19178)
+
2014-11-27 Matthew Leach <address@hidden>
* configure.ac: Merge from preview/configure.ac.
diff --git a/latex.el b/latex.el
index 80d2761..067a776 100644
--- a/latex.el
+++ b/latex.el
@@ -933,7 +933,14 @@ If nil, act like the empty string is given, but do not
prompt."
("eqnarray" . LaTeX-eqnarray-label))
"Lookup prefixes for labels.
An alist where the CAR is the environment name, and the CDR
-either the prefix or a symbol referring to one."
+either the prefix or a symbol referring to one.
+
+If the name is not found, or if the CDR is nil, no label is
+automatically inserted for that environment.
+
+If you want to automatically insert a label for a environment but
+with an empty prefix, use the empty string \"\" as the CDR of the
+corresponding entry."
:group 'LaTeX-label
:type '(repeat (cons (string :tag "Environment")
(choice (string :tag "Label prefix")
@@ -941,10 +948,16 @@ either the prefix or a symbol referring to one."
(make-variable-buffer-local 'LaTeX-label-alist)
-(defun LaTeX-label (name type)
+(defun LaTeX-label (name &optional type)
"Insert a label for NAME at point.
-TYPE can be either environment or section. If
-`LaTeX-label-function' is a valid function, LaTeX label will
+The optional TYPE argument can be either environment or section:
+in the former case this function looks up `LaTeX-label-alist' to
+choose which prefix to use for the label, in the latter case
+`LaTeX-section-label' will be looked up instead. If TYPE is nil,
+you will be always prompted for a label, with an empty default
+prefix.
+
+If `LaTeX-label-function' is a valid function, LaTeX label will
transfer the job to this function."
(let ((prefix (cond
((eq type 'environment)
@@ -955,7 +968,11 @@ transfer the job to this function."
LaTeX-section-label
(and (listp LaTeX-section-label)
(cdr (assoc name LaTeX-section-label))))
- ""))))
+ ""))
+ ((null type)
+ "")
+ (t
+ nil)))
label)
(when (symbolp prefix)
(setq prefix (symbol-value prefix)))
- [elpa] externals/auctex 904dfef 21/36: Fix structure of the package for Windows., (continued)
- [elpa] externals/auctex 904dfef 21/36: Fix structure of the package for Windows., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex 3909e4c 06/36: Several changes suggested by byte-compiler warnings., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex a3f4cac 29/36: Implement forward-search for View command on TeX-region., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex 0c2cfc8 09/36: Replace `read-string' with `TeX-read-string', Stefan Monnier, 2014/11/28
- [elpa] externals/auctex acf1c76 31/36: Document LaTeX-command-section., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex 15edd9b 23/36: Omit f-f hooks and more with TeX-region-create, Stefan Monnier, 2014/11/28
- [elpa] externals/auctex 8f7c399 30/36: Implement LaTeX-command-section., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex e4101ed 25/36: Adapt bug intro text for debbugs., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex 7b427a7 34/36: Merge ELPA changes fixing some byte-compile warnings., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex 58bd866 28/36: Fix indentation in LaTeX-env-figure in a corner case., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex e1ec6a0 33/36: Make second argument of LaTeX-label optional.,
Stefan Monnier <=
- [elpa] externals/auctex 59ccf34 35/36: Check the viewer executable exists before opening it., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex e739b85 32/36: Move preview/ to top-level., Stefan Monnier, 2014/11/28
- [elpa] externals/auctex c390682 36/36: Merge from upstream., Stefan Monnier, 2014/11/28