[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex-cont-latexmk b082dacb78 054/100: some good clean
From: |
ELPA Syncer |
Subject: |
[elpa] externals/auctex-cont-latexmk b082dacb78 054/100: some good clean-up |
Date: |
Thu, 6 Jun 2024 03:57:55 -0400 (EDT) |
branch: externals/auctex-cont-latexmk
commit b082dacb78eb8a834fefde1bc7b895d4e3c8469f
Author: Paul Nelson <ultrono@gmail.com>
Commit: Paul Nelson <ultrono@gmail.com>
some good clean-up
---
czm-tex-compile.el | 99 +++++++++++++++++++++++++++++-------------------------
1 file changed, 53 insertions(+), 46 deletions(-)
diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index c1deee98f8..98dbbbb33d 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -122,21 +122,22 @@ nil if the error is not found."
(setq prefix (buffer-substring-no-properties (point)
(line-end-position)))))
(when prefix
- (let ((pos (with-current-buffer current-buf
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (point-min))
- (forward-line (1- line))
- (let ((truncated-prefix
- (substring prefix
- (max 0 (- (length prefix)
- 3))))
- (line-end (line-end-position))
- (bol (point)))
- (or
- (search-forward truncated-prefix line-end t)
- bol)))))))
+ (let ((pos
+ (with-current-buffer current-buf
+ (save-excursion
+ (save-restriction
+ (widen)
+ (goto-char (point-min))
+ (forward-line (1- line))
+ (let ((truncated-prefix
+ (substring prefix
+ (max 0 (- (length prefix)
+ 3))))
+ (line-end (line-end-position))
+ (bol (point)))
+ (or
+ (search-forward truncated-prefix line-end t)
+ bol)))))))
(when pos
(cons pos (1+ pos)))))))
@@ -157,41 +158,48 @@ Returns a list of triples (ERROR-P DESCRIPTION REGION),
where
ERROR-P is non-nil if the error is an error rather than a
warning, DESCRIPTION is what you'd expect, and REGION is a cons
cell (BEG . END) indicating where the error happens."
- (let* ((current-buf (current-buffer))
- (tex-file (buffer-file-name))
- (log-file (concat (file-name-sans-extension tex-file) ".log"))
- (error-list (czm-tex-compile--error-list log-file)))
- (mapcar
- (lambda (item)
- (let ((type (nth 0 item))
- (file (nth 1 item))
- (line (nth 2 item))
- (message (nth 3 item))
- (context (nth 5 item))
- (_search-string (nth 6 item))
- (is-bad-box (nth 8 item)))
- (when (and
+ (mapcar
+ (lambda (item)
+ (let ((type (nth 0 item))
+ (file (nth 1 item))
+ (line (nth 2 item))
+ (message (nth 3 item))
+ (context (nth 5 item))
+ (_search-string (nth 6 item))
+ (is-bad-box (nth 8 item)))
+ (when-let
+ ((region
+ (cond
+ ((file-equal-p file (buffer-file-name))
+ (and
line
(not (cl-some (lambda (ignored)
(string-match-p ignored message))
czm-tex-compile-ignored-warnings))
(stringp file)
- (or (equal (expand-file-name file)
- (expand-file-name tex-file))
- (and czm-tex-compile-report-multiple-labels
- (string-match-p "multiply defined" message)
- (string-match-p "\\.aux$" file)))
(or (not is-bad-box)
- czm-tex-compile-report-hbox-errors))
- (list (eq type 'error)
- (replace-regexp-in-string "\n" "" message)
- (if (and (not (eq type 'error))
- (string-match-p "multiply defined" message))
- (czm-tex-compile--process-multiply-defined-warning
message current-buf)
- (if (eq type 'error)
- (czm-tex-compile--process-regular-error context line
current-buf)
- (flymake-diag-region current-buf line)))))))
- error-list)))
+ czm-tex-compile-report-hbox-errors)
+ (if (eq type 'error)
+ (czm-tex-compile--process-regular-error context line
(current-buffer))
+ (flymake-diag-region (current-buffer) line))))
+ ((file-equal-p file (TeX-master-file "aux"))
+ (and czm-tex-compile-report-multiple-labels
+ (string-match-p "multiply defined" message)
+ (not (eq type 'error))
+ (let ((label (progn (string-match "`\\(.*\\)'" message)
+ (match-string 1 message))))
+ (save-excursion
+ (save-restriction
+ (widen)
+ (goto-char (point-min))
+ (when (re-search-forward (concat "\\\\label{" label
"}")
+ nil t)
+ (cons (line-beginning-position)
+ (line-end-position)))))))))))
+ (list (eq type 'error)
+ (replace-regexp-in-string "\n" "" message)
+ region))))
+ (czm-tex-compile--error-list (TeX-master-file "log"))))
(defun czm-tex-compile--fresh-p ()
"Return non-nil if logged errors should apply to current buffer.
@@ -200,8 +208,7 @@ current buffer is a file, the current buffer has a log
file, the
log file is newer than the current buffer, and the current
latexmk compilation is in a \"Watching\" state."
(when-let* ((file (buffer-file-name))
- (log-file (concat (file-name-sans-extension file)
- ".log")))
+ (log-file (TeX-master-file "log")))
(and
(when-let ((buf (get-buffer czm-tex-compile--compilation-buffer-name)))
(with-current-buffer buf
- [elpa] externals/auctex-cont-latexmk 2762ee8084 037/100: polish, (continued)
- [elpa] externals/auctex-cont-latexmk 2762ee8084 037/100: polish, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk e5cce65c36 040/100: readme tweaks, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk 989be1a7a9 043/100: flycheck warnings, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk 7e2cbfbc88 046/100: fix defcustom groups, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk 2639003039 059/100: tweaks, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk 2893258541 010/100: docs, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk b5bd4c5257 024/100: indentation, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk e20b97607e 026/100: got it in OK shape, still quite rough tho, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk 1384905db7 050/100: rearrange, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk 7c7fcc15a9 053/100: mild factoring, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk b082dacb78 054/100: some good clean-up,
ELPA Syncer <=
- [elpa] externals/auctex-cont-latexmk 62c2eb652a 031/100: print entire warning message (not every warning is a LaTeX warning), ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk 5473521164 036/100: tweak readme, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk 6cbd9d1493 067/100: respect TeX-output-dir, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk 8333451e17 028/100: re-implement main logic using TeX-parse-all-errors, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk 1aee5cc114 049/100: add "ignored" user option, started rearranging, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk c6d624934e 061/100: some simplifications, clean-up, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk ae9171666e 063/100: tidy, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk 993c2e62fe 068/100: adapt TeX-format-filter to format log more robustly, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk a9d825f79c 069/100: attempt to make compilation command OS-compatible, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk 826cf967f4 070/100: clarify commentary, ELPA Syncer, 2024/06/06