branch: externals/auctex-cont-latexmk
commit 34c8588d7e9d28bd46761918f7efdee4bde2bd12
Author: Paul Nelson <ultr...@gmail.com>
Commit: Paul Nelson <ultr...@gmail.com>

    fix some issues involving multiline warnings
---
 czm-tex-compile.el | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 7da21353f8..bb665b91b2 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -72,7 +72,8 @@ name of the current LaTeX file."
   (when (string-match "\\([^\.]+\\)\.tex" (buffer-name))
     (let* ((name (match-string 1 (buffer-name)))
            (bufname (concat "*eshell-" name "*")))
-      (czm-tex-compile-setup-flymake-backend)
+      (czm-tex-compile-restrict-flymake-backends)
+      ;; (czm-tex-compile-setup-flymake-backend)
       (if (get-buffer bufname)
                 (switch-to-buffer bufname)
               (save-window-excursion
@@ -118,9 +119,10 @@ Used for navigating LaTeX warnings in the log file."
                      (lambda (item)
                        (let* ((error-p (eq (nth 0 item)
                                            'error))
-                              (description-raw (nth 3 item))
+                              (description-raw (nth (if error-p 3 5) item))
                               (description (if error-p description-raw
-                                             (substring description-raw 
(length "LaTeX Warning: "))))
+                                             (substring description-raw
+                                                        (length "LaTeX 
Warning: ") -1)))
                               line prefix
                               region)
                          (if error-p
@@ -136,7 +138,9 @@ Used for navigating LaTeX warnings in the log file."
                                    (setq line (string-to-number (match-string 
1 description)))))
                          (list
                           error-p
-                          description
+                          (replace-regexp-in-string
+                           "\n" ""
+                           description)
                           (when line
                             (if prefix
                                 (let ((pos
@@ -247,5 +251,15 @@ ARGS are the keyword-value pairs concerning edits"
   (add-hook 'flymake-diagnostic-functions #'czm-tex-compile-flymake
             nil t))
 
+(defun czm-tex-compile-restrict-flymake-backends ()
+  (interactive)
+  (setq flymake-diagnostic-functions '(czm-tex-compile-flymake t)))
+
+(defun czm-tex-compile-relax-flymake-backends ()
+  (interactive)
+  (setq flymake-diagnostic-functions '(czm-tex-compile-flymake LaTeX-flymake 
t)))
+
+
+
 (provide 'czm-tex-compile)
 ;;; czm-tex-compile.el ends here

Reply via email to