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. c073d3e3e04832a2c178e


From: Arash Esbati
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. c073d3e3e04832a2c178ef5f5b52f0d4935a5ea2
Date: Thu, 24 Nov 2016 10:58:31 +0000 (UTC)

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  c073d3e3e04832a2c178ef5f5b52f0d4935a5ea2 (commit)
      from  8a14439f4fbb0f8e5d30c689b339e32effbe0177 (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 c073d3e3e04832a2c178ef5f5b52f0d4935a5ea2
Author: Arash Esbati <address@hidden>
Date:   Thu Nov 24 11:57:12 2016 +0100

    Insert \label inside the mandatory argument of \caption
    
    * style/longtable.el ("longtable"): Append \label at the end of
    caption text inside the mandatory argument.
    (LaTeX-longtable-package-options): New variable to suppress the
    query for package options.

diff --git a/style/longtable.el b/style/longtable.el
index a9659dc..76c397b 100644
--- a/style/longtable.el
+++ b/style/longtable.el
@@ -35,11 +35,11 @@
    (LaTeX-add-environments
     '("longtable" (lambda (environment)
                    (let* ((pos (completing-read (TeX-argument-prompt t nil 
"Position")
-                                                 '(("l") ("r") ("c"))))
-                           (fmt (TeX-read-string "Format: " 
LaTeX-default-format))
-                           (caption (TeX-read-string "Caption: "))
-                           (short-caption (when (>= (length caption) 
LaTeX-short-caption-prompt-length)
-                                            (TeX-read-string "(Optional) Short 
caption: "))))
+                                                '(("l") ("r") ("c"))))
+                          (fmt (TeX-read-string "Format: " 
LaTeX-default-format))
+                          (caption (TeX-read-string "Caption: "))
+                          (short-caption (when (>= (length caption) 
LaTeX-short-caption-prompt-length)
+                                           (TeX-read-string "(Optional) Short 
caption: "))))
                      (setq LaTeX-default-format fmt)
                      (LaTeX-insert-environment environment
                                                (concat
@@ -48,17 +48,24 @@
                                                 (concat TeX-grop fmt 
TeX-grcl)))
                      ;; top caption -- do nothing if user skips caption
                      (unless (zerop (length caption))
+                       ;; insert `\caption[short-caption]{caption':
+                       (insert TeX-esc "caption")
+                       (when (and short-caption (not (string= short-caption 
"")))
+                         (insert LaTeX-optop short-caption LaTeX-optcl))
+                       (insert TeX-grop caption)
+                       ;; ask for a label and insert it
+                       (LaTeX-label environment 'environment)
                        ;; the longtable `\caption' is equivalent to a
                        ;; `\multicolumn', so it needs a `\\' at the
-                       ;; end of the line
-                       (insert (LaTeX-compose-caption-macro caption 
short-caption) "\\\\")
+                       ;; end of the line.  Prior to that, add } to
+                       ;; close `\caption{'
+                       (insert TeX-grcl "\\\\")
+                       ;; fill the caption
+                       (LaTeX-fill-paragraph)
+                       ;; Insert a new line and indent
                        (LaTeX-newline)
-                       (indent-according-to-mode)
-                       ;; ask for a label and insert a new line only
-                       ;; if a label is actually inserted
-                       (when (LaTeX-label environment 'environment)
-                         (LaTeX-newline)
-                         (indent-according-to-mode)))))))
+                       (indent-according-to-mode))))))
+
    (TeX-add-symbols
     ;; Commands to end table rows
     '("endhead" 0)
@@ -94,4 +101,10 @@
                              'textual)))
  LaTeX-dialect)
 
+;; `longtable.sty' has two options "errorshow" and "pausing", both for
+;; debugging purposes.  We ignore them both in order to make package
+;; loading faster in a buffer.
+(defvar LaTeX-longtable-package-options nil
+  "Package options for the longtable package.")
+
 ;; longtable.el ends here

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

Summary of changes:
 style/longtable.el |   39 ++++++++++++++++++++++++++-------------
 1 file changed, 26 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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