[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-devel] [elpa] externals/auctex 7d4bfac 18/69: Merge branch 'mast
From: |
Tassilo Horn |
Subject: |
[AUCTeX-devel] [elpa] externals/auctex 7d4bfac 18/69: Merge branch 'master' into simplify-TeX-parse-error |
Date: |
Sat, 26 Mar 2016 21:36:33 +0000 |
branch: externals/auctex
commit 7d4bfacf028203616194b95d5eff7f263d2f6d51
Merge: 312c74a 4c8d64c
Author: Tassilo Horn <address@hidden>
Commit: Tassilo Horn <address@hidden>
Merge branch 'master' into simplify-TeX-parse-error
---
ChangeLog | 14 +++++++
doc/auctex.texi | 34 ++++++++++++++++++
doc/changes.texi | 13 +++++--
latex.el | 100 ++++++++++++++++++++++++++++++++++++------------------
tex-buf.el | 11 +++---
5 files changed, 130 insertions(+), 42 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 2be1b61..806e013 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2014-08-11 Mos� Giordano <address@hidden>
+
+ * tex-buf.el (TeX-command): Keep the frame and the buffer
+ associate to the error overview if the command to be run is View.
+
+ * latex.el (LaTeX-auto-insert-label): New customizable variable.
+ (LaTeX-label): Use it.
+
+ * doc/auctex.texi (Environments): Document
+ `LaTeX-auto-insert-label'.
+
+ * doc/changes.texi: Mention `LaTeX-auto-insert-label'. Fix a
+ couple of bad-boxes in the PDF output of the manual.
+
2014-07-25 Tassilo Horn <address@hidden>
* latex.el (LaTeX-largest-level-set): Adapt
diff --git a/doc/auctex.texi b/doc/auctex.texi
index 7261705..37c7366 100644
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -848,6 +848,40 @@ prefix argument), the current environment is modified and
no new
environment is inserted.
@end deffn
address@hidden helps you adding labels to environments which use them, such
+as @samp{equation}, @samp{figure}, @samp{table}, address@hidden 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.
address@hidden 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.
+
+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,
address@hidden never inserts labels except for the
+environments listed in the cdr; in the latter case
address@hidden 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
address@hidden, as usual.
+
+For example, the value
address@hidden
+(t . "equation")
address@hidden lisp
+makes @AUCTeX{} always prompt you for a label except for the
address@hidden environment. Instead with the value
address@hidden
+(nil . "caption" "figure")
address@hidden lisp
+you will be prompted for a label only for @samp{caption} and
address@hidden environments.
address@hidden defopt
+
As a default selection, @AUCTeX{} will suggest the environment last
inserted or, as the first choice the value of the variable
@code{LaTeX-default-environment}.
diff --git a/doc/changes.texi b/doc/changes.texi
index b408b47..3ce9d34 100644
--- a/doc/changes.texi
+++ b/doc/changes.texi
@@ -26,7 +26,7 @@ by the TeX compiler can be opened with @kbd{M-x
TeX-error-overview
@item
Style file authors are encouraged to distinguish common from expert
-macros/environments, and mark the latter using
+macros and environments, and mark the latter using
@code{TeX-declare-expert-macros} and
@code{LaTeX-declare-expert-environments}.
@@ -53,9 +53,10 @@ non-nil. Completion for class options of the standard
@LaTeX{} classes
is provided as well.
@item
-New user options @code{LaTeX-default-author}, @code{TeX-date-format},
address@hidden, @code{LaTeX-fontspec-arg-font-search},
-and @code{LaTeX-fontspec-font-list-default}. A new possible value
+New user options @code{LaTeX-default-author},
address@hidden,
address@hidden, @code{TeX-date-format}, and
address@hidden A new possible value
(@code{show-all-optional-args}) for
@code{TeX-insert-macro-default-style} was added. The default value of
@code{TeX-source-correlate-method} has been changed.
@@ -127,6 +128,10 @@ per file basis using the @code{TeX-command-extra-options}
option.
@item
Now @kbd{C-c C-e document @key{RET}}, in an empty document, prompts for
@samp{\usepackage} macros in addition to @samp{\documentclass}.
+
address@hidden
+You can customize for which environments a label should be automatically
+inserted or not through the user option @code{LaTeX-auto-insert-label}.
@end itemize
@heading News since 11.87
diff --git a/latex.el b/latex.el
index c798cda..d1ac41f 100644
--- a/latex.el
+++ b/latex.el
@@ -835,6 +835,28 @@ the label inserted, or nil if no label was inserted."
:group 'LaTeX-label
:type 'function)
+(defcustom LaTeX-auto-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."
+ :group 'LaTeX-label
+ :type '(choice (const :tag "Insert labels" t)
+ (const :tag "Do not insert labels" nil)
+ (cons :tag "Whitelist or blacklist environments"
+ (choice
+ (const
+ :tag "Insert labels except for environments..." t)
+ (const
+ :tag "Do not insert labels except for environments..."
+ nil))
+ (repeat (string :tag "Environment")))))
+
(defcustom LaTeX-figure-label "fig:"
"*Default prefix to figure labels."
:group 'LaTeX-label
@@ -923,39 +945,51 @@ either the prefix or a symbol referring to one."
(defun LaTeX-label (environment)
"Insert a label for ENVIRONMENT at point.
-If `LaTeX-label-function' is a valid function, LaTeX label will transfer the
-job to this function."
- (let (label)
- (if (and (boundp 'LaTeX-label-function)
- LaTeX-label-function
- (fboundp LaTeX-label-function))
-
- (setq label (funcall LaTeX-label-function environment))
- (let ((prefix
- (or (cdr (assoc environment LaTeX-label-alist))
- (if (assoc environment LaTeX-section-list)
- (if (stringp LaTeX-section-label)
- LaTeX-section-label
- (and (listp LaTeX-section-label)
- (cdr (assoc environment LaTeX-section-label))))
- ""))))
- (when prefix
- (when (symbolp prefix)
- (setq prefix (symbol-value prefix)))
- ;; Use completing-read as we do with `C-c C-m \label RET'
- (setq label (completing-read
- (TeX-argument-prompt t nil "What label")
- (LaTeX-label-list) nil nil prefix))
- ;; No label or empty string entered?
- (if (or (string= prefix label)
- (string= "" label))
- (setq label nil)
- (insert TeX-esc "label" TeX-grop label TeX-grcl))))
- (if label
- (progn
- (LaTeX-add-labels label)
- label)
- nil))))
+`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."
+ (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)))
+ ;; In any other cases, insert the label.
+ (t))
+ (let (label)
+ (if (and (boundp 'LaTeX-label-function)
+ LaTeX-label-function
+ (fboundp LaTeX-label-function))
+
+ (setq label (funcall LaTeX-label-function environment))
+ (let ((prefix
+ (or (cdr (assoc environment LaTeX-label-alist))
+ (if (assoc environment LaTeX-section-list)
+ (if (stringp LaTeX-section-label)
+ LaTeX-section-label
+ (and (listp LaTeX-section-label)
+ (cdr (assoc environment LaTeX-section-label))))
+ ""))))
+ (when prefix
+ (when (symbolp prefix)
+ (setq prefix (symbol-value prefix)))
+ ;; Use completing-read as we do with `C-c C-m \label RET'
+ (setq label (completing-read
+ (TeX-argument-prompt t nil "What label")
+ (LaTeX-label-list) nil nil prefix))
+ ;; No label or empty string entered?
+ (if (or (string= prefix label)
+ (string= "" label))
+ (setq label nil)
+ (insert TeX-esc "label" TeX-grop label TeX-grcl))))
+ (if label
+ (progn
+ (LaTeX-add-labels label)
+ label)
+ nil)))))
(defun LaTeX-env-figure (environment)
"Create ENVIRONMENT with \caption and \label commands."
diff --git a/tex-buf.el b/tex-buf.el
index 0c9ff6f..a466446 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -362,11 +362,12 @@ asked if it is positive, and suppressed if it is not."
nil nil)))
;; Kill the frame and buffer associated to the error overview before
running
- ;; the command.
- (if (frame-live-p TeX-error-overview-frame)
- (delete-frame TeX-error-overview-frame))
- (if (get-buffer TeX-error-overview-buffer-name)
- (kill-buffer TeX-error-overview-buffer-name))
+ ;; the command, but keep them if the command to be run is View.
+ (unless (string= name "View")
+ (if (frame-live-p TeX-error-overview-frame)
+ (delete-frame TeX-error-overview-frame))
+ (if (get-buffer TeX-error-overview-buffer-name)
+ (kill-buffer TeX-error-overview-buffer-name)))
;; Now start the process
(setq file (funcall file))
- [AUCTeX-devel] [elpa] externals/auctex c34bf64 07/69: Merge branch 'master' into simplify-TeX-parse-error, (continued)
- [AUCTeX-devel] [elpa] externals/auctex c34bf64 07/69: Merge branch 'master' into simplify-TeX-parse-error, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 056d8c8 50/69: Fix TeX-check-files, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex e4cad1c 46/69: Add support for Atril viewer, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 188e4b1 66/69: Temporarily bind gc-cons-threshold in time-consuming task, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex d4059b8 02/69: Improve line wrap removal heuristics., Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex f1bcbe3 54/69: Improve LaTeX-warnings-regexp, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 0731fff 10/69: Merge branch 'master' into simplify-TeX-parse-error, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 8926369 06/69: Improve new-file regex., Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex f7d0535 34/69: Fix file name regexp in TeX-documentation-texdoc, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex c09c405 48/69: Fix wrong usage of `TeX-auto-prepare-hook', Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 7d4bfac 18/69: Merge branch 'master' into simplify-TeX-parse-error,
Tassilo Horn <=
- [AUCTeX-devel] [elpa] externals/auctex 2cca33f 42/69: Minor fix in TeX-documentation-texdoc, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex a1473f7 33/69: Capture warnings from packages with hyphens in name, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 4837aba 26/69: Merge branch 'master' into simplify-TeX-parse-error, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 2c21439 41/69: Improve parsing of certain warnings, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 08ae29b 19/69: Merge branch 'master' into simplify-TeX-parse-error, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex b72dcb7 44/69: Add support for SumatraPDF viewer, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 2888571 52/69: Allow ignoring certain warnings, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 16f3dd4 43/69: Add support for Zathura viewer, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex cfa82d8 65/69: Prompt for optional short caption parameter., Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 2e543ef 58/69: Fix parsing of vertical bad boxes context, Tassilo Horn, 2016/03/26