auctex-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX-diffs] GNU AUCTeX branch, master, updated. e1ec6a022a7cc03c6978f


From: Mosè Giordano
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. e1ec6a022a7cc03c6978f5401486334bb21ac94a
Date: Thu, 27 Nov 2014 18:17:24 +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  e1ec6a022a7cc03c6978f5401486334bb21ac94a (commit)
      from  e739b857429fa6b6952adadc40af7b69195a4dc2 (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 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)

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)))

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog |    6 ++++++
 latex.el  |   27 ++++++++++++++++++++++-----
 2 files changed, 28 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

[Prev in Thread] Current Thread [Next in Thread]