[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-diffs] [elpa] externals/auctex 69fc320 27/57: Add a newline only
From: |
Tassilo Horn |
Subject: |
[AUCTeX-diffs] [elpa] externals/auctex 69fc320 27/57: Add a newline only if \label is inserted |
Date: |
Wed, 11 Jan 2017 18:01:39 +0000 (UTC) |
branch: externals/auctex
commit 69fc320c6f713806616b9722adcb12fa8fc4b297
Author: Arash Esbati <address@hidden>
Commit: Arash Esbati <address@hidden>
Add a newline only if \label is inserted
* style/caption.el (LaTeX-arg-caption-captionof):
* style/bicaption.el (LaTeX-arg-bicaption-bicaption): Save the
position before asking for a label. Add a newline only if a label
is inserted.
---
style/bicaption.el | 9 +++++----
style/caption.el | 27 +++++++++++++++------------
2 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/style/bicaption.el b/style/bicaption.el
index b361393..ad3b0ca 100644
--- a/style/bicaption.el
+++ b/style/bicaption.el
@@ -110,11 +110,12 @@ arguments."
(TeX-argument-insert width t)
(TeX-argument-insert inpos t)))
(LaTeX-fill-paragraph)
- ;; Insert label
- (when (and (not label-inside) (not star))
+ ;; Insert label -- a new line is inserted only if label is there:
+ (when (and (not label-inside) (not star)
+ (save-excursion (LaTeX-label currenv 'environment)))
(LaTeX-newline)
(indent-according-to-mode)
- (LaTeX-label currenv 'environment))))
+ (end-of-line))))
(defun LaTeX-arg-bicaption-captionsetup (optional)
"Query for 2 arguments for \"\captionsetup\" with bicaption.sty loaded.
@@ -143,7 +144,7 @@ square brackets."
(TeX-add-symbols
'("bicaption" (LaTeX-arg-bicaption-bicaption))
'("bicaption*" (LaTeX-arg-bicaption-bicaption nil t))
- '("bicaptionbox" (LaTeX-arg-bicaption-bicaption nil nil t t) t)
+ '("bicaptionbox" (LaTeX-arg-bicaption-bicaption nil nil t t) t)
'("bicaptionbox*" (LaTeX-arg-bicaption-bicaption nil t t) t)
'("bisubcaption" (LaTeX-arg-bicaption-bicaption "sub-"))
'("bisubcaption*" (LaTeX-arg-bicaption-bicaption "sub-" t))
diff --git a/style/caption.el b/style/caption.el
index f4b2ab0..f955c27 100644
--- a/style/caption.el
+++ b/style/caption.el
@@ -294,21 +294,24 @@ STAR is non-nil, do not query for a short-caption and a
label."
(TeX-argument-insert caption optional)
(LaTeX-fill-paragraph)
(unless star
- (LaTeX-newline)
- (indent-according-to-mode)
;; Check if `envtype' is a figure or a table, also consult
;; `LaTeX-label-alist' for additions from user or newfloat.el,
;; then run `LaTeX-label' w/ 'environment arg, otherwise w/o.
- (if (or (member envtype figtypes)
- (member envtype tabtypes)
- (assoc envtype LaTeX-label-alist))
- (LaTeX-label (cond ((member envtype figtypes)
- "figure")
- ((member envtype tabtypes)
- "table")
- (t envtype))
- 'environment)
- (LaTeX-label envtype)))))
+ (save-excursion
+ (if (or (member envtype figtypes)
+ (member envtype tabtypes)
+ (assoc envtype LaTeX-label-alist))
+ (LaTeX-label (cond ((member envtype figtypes)
+ "figure")
+ ((member envtype tabtypes)
+ "table")
+ (t envtype))
+ 'environment)
+ (LaTeX-label envtype)))
+ (when (looking-at-p "\\label{")
+ (LaTeX-newline)
+ (indent-according-to-mode)
+ (end-of-line)))))
(TeX-add-style-hook
"caption"
- [AUCTeX-diffs] [elpa] externals/auctex 4c42f7a 25/57: Revert "Remove multi-level/invisible feature of font-latex-fontify-script", (continued)
- [AUCTeX-diffs] [elpa] externals/auctex 4c42f7a 25/57: Revert "Remove multi-level/invisible feature of font-latex-fontify-script", Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex 1addc62 30/57: Use RefTeX for multiple citations in biblatex, Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex 0b16551 51/57: * Makefile.in (release-commit): Use UTF-8 coding for ChangeLog entry., Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex 0766526 41/57: Don't use cl function copy-list, Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex a181b14 55/57: ; make change-history-commit, Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex 61e56f2 40/57: Fix bug where font-latex-sub/superscript-face was not applied to ^_, Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex bc47cb0 39/57: Fontify script characters with a new face, Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex bef4873 22/57: Set `reftex-set-cite-format' to biblatex or natbib, Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex 1de2359 13/57: Add new style/titlesec.el, Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex 01da194 23/57: ; * style/titletoc.el ("titletoc"): Use `TeX-arg-length'., Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex 69fc320 27/57: Add a newline only if \label is inserted,
Tassilo Horn <=
- [AUCTeX-diffs] [elpa] externals/auctex 343ca9c 36/57: Fix script unfontification bug, Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex 0e54895 34/57: Improve completion docs, Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex 436371c 31/57: Add completion-at-point support, Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex e9c4b68 35/57: ; * doc/auctex.texi (Completion): Use @defun and not @deffn., Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex 93b1163 50/57: * ChangeLog-preview: Change encoding to UTF-8., Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex 4ebbf90 56/57: Make gitlog-to-changelog ignore release-commit, Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex 5af3c8e 15/57: Add \switchcolumn to paragraph commands, Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex bfc7e90 16/57: Fix fontification for natbib compat macros, Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex ccec850 24/57: Remove multi-level/invisible feature of font-latex-fontify-script, Tassilo Horn, 2017/01/11
- [AUCTeX-diffs] [elpa] externals/auctex c3a21f2 04/57: Print only first line of the message in error overview, Tassilo Horn, 2017/01/11