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. 3b5f047045557baa00f6a


From: Mosè Giordano
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 3b5f047045557baa00f6a5bc26cf1b24037145a8
Date: Mon, 05 Oct 2015 21:22:22 +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  3b5f047045557baa00f6a5bc26cf1b24037145a8 (commit)
       via  e85968c22de15113c1c778b1bcc546f6ae376a49 (commit)
      from  1ec0278e620542285df51086a3de9cd7792e5142 (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 3b5f047045557baa00f6a5bc26cf1b24037145a8
Author: Mosè Giordano <address@hidden>
Date:   Mon Oct 5 23:21:09 2015 +0200

    Add supporto to ConTeXt Mark IV in some sentinels.
    
    * context.el (TeX-ConTeXt-sentinel): Parse ConTeXt Mark IV output.
    
    * tex-buf.el (TeX-TeX-sentinel-check): Ditto.

diff --git a/ChangeLog b/ChangeLog
index 61de4d3..b287587 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-10-05  Mosè Giordano  <address@hidden>
+
+       * context.el (TeX-ConTeXt-sentinel): Parse ConTeXt Mark IV output.
+
+       * tex-buf.el (TeX-TeX-sentinel-check): Ditto.
+
 2015-10-05  Arash Esbati  <address@hidden>
 
        * style/newfloat.el (LaTeX-newfloat-auto-cleanup): Check if
diff --git a/context.el b/context.el
index 0aa7311..ccd32a5 100644
--- a/context.el
+++ b/context.el
@@ -564,28 +564,43 @@ inserted after the sectioning command."
 ;; Various
 (defun TeX-ConTeXt-sentinel (process name)
   "Cleanup TeX output buffer after running ConTeXt."
-  (cond ((TeX-TeX-sentinel-check process name))
-       ((save-excursion
-          ;; in a full ConTeXt run there will multiple texutil
-          ;; outputs. Just looking for "another run needed" would
-          ;; find the first occurence
-          (goto-char (point-max))
-          (re-search-backward "TeXUtil " nil t)
-          (re-search-forward "another run needed" nil t))
-        (message (concat "You should run ConTeXt again "
-                         "to get references right, "
-                         (TeX-current-pages)))
-        (setq TeX-command-next TeX-command-default))
-       ((re-search-forward "removed files :" nil t)
-        (message "sucessfully cleaned up"))
-       ((re-search-forward "^ ?TeX\\(Exec\\|Util\\)" nil t) ;; strange regexp 
--pg
-        (message (concat name ": successfully formatted "
-                         (TeX-current-pages)))
-        (setq TeX-command-next TeX-command-Show))
-       (t
-        (message (concat name ": problems after "
-                         (TeX-current-pages)))
-        (setq TeX-command-next TeX-command-default))))
+  (cond
+   ;; Mark IV
+   ((with-current-buffer TeX-command-buffer
+      (string= ConTeXt-Mark-version "IV"))
+    (cond ((TeX-TeX-sentinel-check process name))
+         ((re-search-forward "fatal error: " nil t)
+          (message (concat name ": problems after "
+                           (TeX-current-pages name)))
+          (setq TeX-command-next TeX-command-default))
+         (t
+          (message (concat name ": successfully formatted "
+                           (TeX-current-pages name)))
+          (setq TeX-command-next TeX-command-Show))))
+   ;; Mark II
+   (t
+    (cond ((TeX-TeX-sentinel-check process name))
+         ((save-excursion
+            ;; in a full ConTeXt run there will multiple texutil
+            ;; outputs. Just looking for "another run needed" would
+            ;; find the first occurence
+            (goto-char (point-max))
+            (re-search-backward "TeXUtil " nil t)
+            (re-search-forward "another run needed" nil t))
+          (message (concat "You should run ConTeXt again "
+                           "to get references right, "
+                           (TeX-current-pages)))
+          (setq TeX-command-next TeX-command-default))
+         ((re-search-forward "removed files :" nil t)
+          (message "sucessfully cleaned up"))
+         ((re-search-forward "^ ?TeX\\(Exec\\|Util\\)" nil t) ;; strange 
regexp --pg
+          (message (concat name ": successfully formatted "
+                           (TeX-current-pages)))
+          (setq TeX-command-next TeX-command-Show))
+         (t
+          (message (concat name ": problems after "
+                           (TeX-current-pages)))
+          (setq TeX-command-next TeX-command-default))))))
 
 
 ;;; Environments
diff --git a/tex-buf.el b/tex-buf.el
index bfe684e..d42b547 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -1292,17 +1292,33 @@ errors or warnings to show."
 Return nil ifs no errors were found."
   (save-excursion
     (goto-char (point-max))
-    (if (re-search-backward "^Output written on \\(.*?\\) (\\([0-9]+\\) page"
-                           nil t)
+    (cond
+     ((and (string-match "ConTeXt" name)
+          (with-current-buffer TeX-command-buffer
+            (string= ConTeXt-Mark-version "IV")))
+      (when (re-search-backward " > result saved in file: \\(.*?\\), " nil t)
        (let ((output-file (TeX-match-buffer 1)))
-         (setq TeX-current-page (concat "{" (TeX-match-buffer 2) "}"))
          ;; Shave off quotation marks if present.
          (when (string-match "\\`\"\\(.*\\)\"\\'" output-file)
            (setq output-file (match-string 1 output-file)))
          (setq TeX-output-extension
                (if (string-match "\\.\\([^.]*\\)$" output-file)
                    (match-string 1 output-file)
-                 "dvi")))))
+                 "dvi")))
+       (if (re-search-forward ", \\([0-9]+\\) shipped pages, " nil t)
+           (setq TeX-current-page (concat "{" (TeX-match-buffer 1) "}")))))
+     (t
+      (if (re-search-backward "^Output written on \\(.*?\\) (\\([0-9]+\\) page"
+                             nil t)
+         (let ((output-file (TeX-match-buffer 1)))
+           (setq TeX-current-page (concat "{" (TeX-match-buffer 2) "}"))
+           ;; Shave off quotation marks if present.
+           (when (string-match "\\`\"\\(.*\\)\"\\'" output-file)
+             (setq output-file (match-string 1 output-file)))
+           (setq TeX-output-extension
+                 (if (string-match "\\.\\([^.]*\\)$" output-file)
+                     (match-string 1 output-file)
+                   "dvi")))))))
   (if process (TeX-format-mode-line process))
   (if (re-search-forward "^\\(!\\|.*:[0-9]+:\\) " nil t)
       (progn

commit e85968c22de15113c1c778b1bcc546f6ae376a49
Author: Arash Esbati <address@hidden>
Date:   Mon Oct 5 22:56:08 2015 +0200

    Support caption.el and some other fixes.
    
    * style/newfloat.el (LaTeX-newfloat-auto-cleanup): Check if
    `LaTeX-caption-supported-float-types' from caption.el is bound and
    update it accordingly.  Fix docstring.
    ("newfloat"): Fix wrong check with (LaTeX-largest-level).
    ("newfloat"): Use `LaTeX-newfloat-key-val-options-local' and
    delete redundant code.
    
    Signed-off-by: Mosè Giordano <address@hidden>

diff --git a/ChangeLog b/ChangeLog
index 0f9b067..61de4d3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2015-10-05  Arash Esbati  <address@hidden>
+
+       * style/newfloat.el (LaTeX-newfloat-auto-cleanup): Check if
+       `LaTeX-caption-supported-float-types' from caption.el is bound and
+       update it accordingly.  Fix docstring.
+       ("newfloat"): Fix wrong check with (LaTeX-largest-level).
+       ("newfloat"): Use `LaTeX-newfloat-key-val-options-local' and
+       delete redundant code.
+
 2015-10-04  Mosè Giordano  <address@hidden>
 
        * context.el (ConTeXt-Mark-version): New customizable and
diff --git a/style/newfloat.el b/style/newfloat.el
index 48cee5e..4cde32e 100644
--- a/style/newfloat.el
+++ b/style/newfloat.el
@@ -87,7 +87,7 @@
 
 (defun LaTeX-newfloat-auto-prepare ()
   "Clear `LaTeX-auto-newfloat-DeclareFloatingEnvironment' before parsing."
-  (setq        LaTeX-auto-newfloat-DeclareFloatingEnvironment nil))
+  (setq LaTeX-auto-newfloat-DeclareFloatingEnvironment nil))
 
 (defun LaTeX-newfloat-auto-cleanup ()
   "Process definded floats with \\DeclareFloatingEnvironment.
@@ -97,7 +97,9 @@ AUCTeX (\"figure\", \"table\" or \"verbatim\"), update
 loaded, add the new floating environment via
 `reftex-add-label-environments'.  For \"verbatim\" environments,
 update `LaTeX-indent-environment-list' to suppress indentation.
-Also define the macros \"listofENVs\" and \"listofENVes\"."
+If `caption.el' is loaded, add the new floating environment to
+`LaTeX-caption-supported-float-types'.  Also define the macros
+\"listofENVs\" and \"listofENVes\"."
   (dolist (flt-type (LaTeX-newfloat-DeclareFloatingEnvironment-list))
     (let ((flt  (car  flt-type))
          (type (cadr flt-type)))
@@ -122,6 +124,9 @@ Also define the macros \"listofENVs\" and \"listofENVes\"."
                `((,flt ?l "lst:" "~\\ref{%s}" caption nil nil)))))
            (t
             (LaTeX-add-environments flt)))
+      (when (boundp 'LaTeX-caption-supported-float-types)
+       (add-to-list (make-local-variable 'LaTeX-caption-supported-float-types)
+                    flt))
       (if (string-equal "e" (substring flt -1))
          (TeX-add-symbols (concat "listof" flt "s"))
        (TeX-add-symbols
@@ -144,7 +149,7 @@ Also define the macros \"listofENVs\" and \"listofENVes\"."
    (setq LaTeX-newfloat-key-val-options-local
         (copy-alist LaTeX-newfloat-key-val-options))
 
-   (if (= (LaTeX-largest-level) 1)
+   (if (< (LaTeX-largest-level) 2)
        (add-to-list 'LaTeX-newfloat-key-val-options-local
                    '("within" ("chapter" "section" "none")))
      (add-to-list 'LaTeX-newfloat-key-val-options-local
@@ -165,15 +170,7 @@ Also define the macros \"listofENVs\" and \"listofENVes\"."
       (TeX-arg-eval completing-read
                    (TeX-argument-prompt nil nil "Floating environment")
                    (mapcar 'car 
(LaTeX-newfloat-DeclareFloatingEnvironment-list)))
-      (TeX-arg-eval
-       (lambda ()
-        (let ((keyvals (TeX-read-key-val
-                        nil
-                        (append (if (= (LaTeX-largest-level) 1)
-                                    '(("within" ("chapter" "section" "none")))
-                                  '(("within" ("section" "none"))))
-                                LaTeX-newfloat-key-val-options))))
-          (format "%s" keyvals)))))
+      (TeX-arg-key-val LaTeX-newfloat-key-val-options-local))
 
     '("ForEachFloatingEnvironment" t)
     '("ForEachFloatingEnvironment*" t)
@@ -190,7 +187,7 @@ Also define the macros \"listofENVs\" and \"listofENVes\"."
         (let ((keyvals (TeX-read-key-val
                         nil
                         (append '(("chapterlistsgap"))
-                                (if (= (LaTeX-largest-level) 1)
+                                (if (< (LaTeX-largest-level) 2)
                                     '(("within" ("chapter" "section" "none")))
                                   '(("within" ("section" "none"))))))))
           (format "%s" keyvals))))))
@@ -212,7 +209,7 @@ Also define the macros \"listofENVs\" and \"listofENVes\"."
    t
    (append
     '(("chapterlistsgap"))
-    (if (= (LaTeX-largest-level) 1)
+    (if (< (LaTeX-largest-level) 2)
        '(("within" ("chapter" "section" "none")))
       '(("within" ("section" "none")))))))
 

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

Summary of changes:
 ChangeLog         |   15 +++++++++++++
 context.el        |   59 +++++++++++++++++++++++++++++++++-------------------
 style/newfloat.el |   25 +++++++++------------
 tex-buf.el        |   24 ++++++++++++++++++---
 4 files changed, 83 insertions(+), 40 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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