branch: externals/auctex commit 08ae29ba182d25932719fc149b607e884af11dcf Merge: 7d4bfac 765c516 Author: Tassilo Horn <t...@gnu.org> Commit: Tassilo Horn <t...@gnu.org>
Merge branch 'master' into simplify-TeX-parse-error --- ChangeLog | 16 +++++++++++++ doc/auctex.texi | 64 +++++++++++++++++++++++++++++++++-------------------- doc/changes.texi | 5 ++- latex.el | 43 ++++++++++++++++++----------------- 4 files changed, 81 insertions(+), 47 deletions(-) diff --git a/ChangeLog b/ChangeLog index 806e013..5f71fa0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2014-08-12 Mos� Giordano <m...@gnu.org> + + * latex.el (LaTeX-insert-label): Rename from + `LaTeX-auto-insert-label' and mention sections in the doc-string. + (LaTeX-label): Update accordingly. + + * doc/auctex.texi (Sectioning): Mention `LaTeX-insert-label'. + (Environments): Update `LaTeX-insert-label' name and document use + for sectioning commands. + (Environments, Completion): Prettify + `TeX-complete-expert-commands' documentation by using a table + environment. + + * doc/changes.texi: Rename `LaTeX-auto-insert-label' to + `LaTeX-insert-label' and mention sections too. + 2014-08-11 Mos� Giordano <m...@gnu.org> * tex-buf.el (TeX-command): Keep the frame and the buffer diff --git a/doc/auctex.texi b/doc/auctex.texi index 37c7366..d85a4d3 100644 --- a/doc/auctex.texi +++ b/doc/auctex.texi @@ -734,6 +734,12 @@ Prefix to all section references. @end deffn +@vindex LaTeX-insert-label +The @code{LaTeX-insert-label} user option controls whether +@code{LaTeX-section} should automatically insert a label for the given +sectioning command. By default, a label for all sectioning commands +will be prompted. @xref{Environments}, for more information. + The precise behavior of @code{LaTeX-section} is defined by the contents of @code{LaTeX-section-hook}. @@ -853,33 +859,33 @@ as @samp{equation}, @samp{figure}, @samp{table}, etc@dots{} When you insert one of the supported environments with @kbd{C-c C-e}, you will be automatically prompted for a label. If you want to select the environments for which to automatically insert or not the label, -customize the @code{LaTeX-auto-insert-label} variable. -@defopt LaTeX-auto-insert-label -Control whether @code{LaTeX-environment} (@kbd{C-c C-e}) should insert a -label. If nil, never inserts a label, if t always inserts a label and -this the default. +customize the @code{LaTeX-insert-label} variable. +@defopt LaTeX-insert-label +Control whether @code{LaTeX-section} (@kbd{C-c C-s}) or +@code{LaTeX-environment} (@kbd{C-c C-e}) should insert a label. If nil, +never insert a label, if t always insert a label and this the default. This variable may also be a cons cell, to whitelist or blacklist the -environments for which a label should or should not be inserted. The -car can be either nil or t. In the former case, -@code{LaTeX-environment} never inserts labels except for the -environments listed in the cdr; in the latter case -@code{LaTeX-environment} always inserts labels except for the -environments listed in the cdr. In any cases, you can manually insert -at point a label inside an environment with @kbd{C-c C-m label -@key{RET}}, as usual. +sections or environments for which a label should or should not be +inserted. The car can be either nil or t. In the former case, +@code{LaTeX-section} and @code{LaTeX-environment} never insert labels +except for the sections and environments listed in the cdr; in the +latter case those functions always insert labels except for the sections +and environments listed in the cdr. In any cases, you can manually +insert a label at point with @kbd{C-c C-m label @key{RET}}, as usual. For example, the value @lisp -(t . "equation") +(t . "paragraph" "equation") @end lisp makes @AUCTeX{} always prompt you for a label except for the -@samp{equation} environment. Instead with the value +@samp{paragraph} section, and th @samp{equation} environment. Instead +with the value @lisp -(nil . "caption" "figure") +(nil . "part" "chapter" "caption" "figure") @end lisp -you will be prompted for a label only for @samp{caption} and -@samp{figure} environments. +you will be prompted for a label only for @samp{part} and @samp{chapter} +sections, and @samp{caption} and @samp{figure} environments. @end defopt As a default selection, @AUCTeX{} will suggest the environment last @@ -916,9 +922,14 @@ Complete macros and environments marked as expert commands. Possible values are nil, t, or a list of style names. - - nil Don't complete expert commands (default). - - t Always complete expert commands. - - (STYLES ...) Only complete expert commands of STYLES. +@table @asis +@item nil +Don't complete expert commands (default). +@item t +Always complete expert commands. +@item (STYLES @dots{}) +Only complete expert commands of STYLES. +@end table @end defopt @@ -1315,9 +1326,14 @@ Complete macros and environments marked as expert commands. Possible values are nil, t, or a list of style names. - - nil Don't complete expert commands (default). - - t Always complete expert commands. - - (STYLES ...) Only complete expert commands of STYLES. +@table @asis +@item nil +Don't complete expert commands (default). +@item t +Always complete expert commands. +@item (STYLES @dots{}) +Only complete expert commands of STYLES. +@end table @end defopt diff --git a/doc/changes.texi b/doc/changes.texi index 3ce9d34..a717217 100644 --- a/doc/changes.texi +++ b/doc/changes.texi @@ -130,8 +130,9 @@ Now @kbd{C-c C-e document @key{RET}}, in an empty document, prompts for @samp{\usepackage} macros in addition to @samp{\documentclass}. @item -You can customize for which environments a label should be automatically -inserted or not through the user option @code{LaTeX-auto-insert-label}. +You can customize for which sections and environments a label should be +automatically inserted or not through the new user option +@code{LaTeX-insert-label}. @end itemize @heading News since 11.87 diff --git a/latex.el b/latex.el index d1ac41f..52ea574 100644 --- a/latex.el +++ b/latex.el @@ -835,27 +835,28 @@ the label inserted, or nil if no label was inserted." :group 'LaTeX-label :type 'function) -(defcustom LaTeX-auto-insert-label t +(defcustom LaTeX-insert-label t "Control whether `LaTeX-label' function should insert a label. If nil, never inserts a label, if t always inserts a label. This variable may also be a cons cell, to whitelist or blacklist -the environments for which a label should or should not be -inserted. The CAR can be either nil or t. In the former case, -`LaTeX-label' never inserts labels except for the environments -listed in the CDR; in the latter case `LaTeX-label' always -inserts labels except for the environments listed in the CDR." +the sections or environments for which a label should or should +not be inserted. The CAR can be either nil or t. In the former +case, `LaTeX-label' never inserts labels except for the sections +and environments listed in the CDR; in the latter case +`LaTeX-label' always inserts labels except for the sections and +environments listed in the CDR." :group 'LaTeX-label :type '(choice (const :tag "Insert labels" t) (const :tag "Do not insert labels" nil) - (cons :tag "Whitelist or blacklist environments" + (cons :tag "Whitelist or blacklist" (choice (const - :tag "Insert labels except for environments..." t) + :tag "Insert labels except for sections and environments..." t) (const - :tag "Do not insert labels except for environments..." + :tag "Do not insert labels except for sections and environments..." nil)) - (repeat (string :tag "Environment"))))) + (repeat (string :tag "Section or Environment"))))) (defcustom LaTeX-figure-label "fig:" "*Default prefix to figure labels." @@ -945,18 +946,18 @@ either the prefix or a symbol referring to one." (defun LaTeX-label (environment) "Insert a label for ENVIRONMENT at point. -`LaTeX-auto-insert-label' controls whether the label should -actually be inserted. If `LaTeX-label-function' is a valid -function, LaTeX label will transfer the job to this function." +`LaTeX-insert-label' controls whether the label should actually +be inserted. If `LaTeX-label-function' is a valid function, +LaTeX label will transfer the job to this function." (if (cond - ;; `LaTeX-auto-insert-label' is boolean. - ((booleanp LaTeX-auto-insert-label) - LaTeX-auto-insert-label) - ;; `LaTeX-auto-insert-label' is a whitelist or a blacklist. - ((consp LaTeX-auto-insert-label) - (if (member environment (cdr LaTeX-auto-insert-label)) - (null (car LaTeX-auto-insert-label)) - (car LaTeX-auto-insert-label))) + ;; `LaTeX-insert-label' is boolean. + ((booleanp LaTeX-insert-label) + LaTeX-insert-label) + ;; `LaTeX-insert-label' is a whitelist or a blacklist. + ((consp LaTeX-insert-label) + (if (member environment (cdr LaTeX-insert-label)) + (null (car LaTeX-insert-label)) + (car LaTeX-insert-label))) ;; In any other cases, insert the label. (t)) (let (label)