[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex-cont-latexmk 776337f0d8 013/100: Fix the directi
From: |
ELPA Syncer |
Subject: |
[elpa] externals/auctex-cont-latexmk 776337f0d8 013/100: Fix the direction issue |
Date: |
Thu, 6 Jun 2024 03:57:51 -0400 (EDT) |
branch: externals/auctex-cont-latexmk
commit 776337f0d82e26ef57a1a639e6a6024a8f69d185
Author: Paul Nelson <ultrono@gmail.com>
Commit: Paul Nelson <ultrono@gmail.com>
Fix the direction issue
---
czm-tex-compile.el | 77 +++++++++++++++++++++++++++++++++---------------------
1 file changed, 47 insertions(+), 30 deletions(-)
diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index abd61469c6..924a485419 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -100,6 +100,9 @@ Used for navigating LaTeX warnings in the log file."
;; find-file-noselect, etc. Similarly, do the same for .aux files in
;; your other packages (tex-util, preview).
+(defvar czm-tex-compile--debug nil
+ "Whether to print debugging information.")
+
(defun czm-tex-compile--navigate-log-error (direction)
"Helper function to navigate warnings in the log file.
DIRECTION should be either \='next or \='previous."
@@ -121,35 +124,43 @@ DIRECTION should be either \='next or \='previous."
(if (eq direction 'previous) #'re-search-backward
#'re-search-forward)))
(when (eq direction 'next)
(forward-line 2))
- (when (funcall search-fn
- (concat "^"
- (regexp-opt
- '("! "
- "LaTeX Warning: "))
- "[^ ]")
- nil t)
- (goto-char (match-beginning 0))
- (let ((error-p (looking-at "! ")))
- (setq last-navigation-time (current-time))
- (setq description
- (if error-p
- (buffer-substring-no-properties
- (point) (line-end-position))
- (czm-tex-compile--paragraph-as-line)))
- (if error-p
- (progn
- (save-excursion
- (re-search-forward "^l\\.\\([0-9]+\\) " nil t)
- (let ((line-number (string-to-number (match-string 1)))
- (line-prefix (buffer-substring-no-properties
- (point) (line-end-position))))
- (setq line (cons line-number line-prefix)))))
- (when (string-match "input line \\([0-9]+\\)" description)
- (setq line (string-to-number (match-string 1 description)))))
- ;; (forward-line -1)
- (forward-line (if (eq direction 'previous) -1 1))
-
- (setq log-pos (point))))))
+ (setq log-pos
+ (cond
+ ((funcall search-fn
+ (concat "^"
+ (regexp-opt
+ '("! "
+ "LaTeX Warning: "))
+ "[^ ]")
+ nil t)
+ (goto-char (match-beginning 0))
+ (let ((error-p (looking-at "! ")))
+ (setq last-navigation-time (current-time))
+ (setq description
+ (if error-p
+ (buffer-substring-no-properties
+ (point) (line-end-position))
+ (czm-tex-compile--paragraph-as-line)))
+ (if error-p
+ (progn
+ (save-excursion
+ (re-search-forward "^l\\.\\([0-9]+\\) " nil t)
+ (let ((line-number (string-to-number (match-string
1)))
+ (line-prefix (buffer-substring-no-properties
+ (point) (line-end-position))))
+ (setq line (cons line-number line-prefix)))))
+ (when (string-match "input line \\([0-9]+\\)" description)
+ (setq line (string-to-number (match-string 1
description)))))
+ (forward-line -1)
+ ;; (forward-line (if (eq direction 'previous) -1 1))
+
+ (point)))
+ ((eq direction 'next)
+ (point-max))
+ ((eq direction 'previous)
+ (point-min))
+ (t
+ (error "Unknown direction: %s" direction))))))
(unless already-open
(kill-buffer buf))
(setq-local czm-tex-compile--log-state (cons last-navigation-time log-pos))
@@ -171,7 +182,13 @@ DIRECTION should be either \='next or \='previous."
(widen))
(goto-char pos)
(recenter)))
- (message (or description "No further errors or warnings."))))
+ (message
+ (concat (or description "No further errors or warnings.")
+ (when czm-tex-compile--debug
+ " -- "
+ (format "%s" (cdr czm-tex-compile--log-state)))))))
+
+
;;;###autoload
(defun czm-tex-compile-previous-error ()
- [elpa] externals/auctex-cont-latexmk a3ba987e68 074/100: add tex-continuous--build-file back in, at least for now, (continued)
- [elpa] externals/auctex-cont-latexmk a3ba987e68 074/100: add tex-continuous--build-file back in, at least for now, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk d99ee12fe2 077/100: Allow updates when process buffer is empty, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk d63f7e1327 094/100: Rearrange file to clarify division of responsibility, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk b34fcf062a 098/100: add local variable tex-continuous-force-enable, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk 3eeebb581f 008/100: Fix "repeat when reversing direction" nuisance, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk dc130e1bfe 021/100: Merge pull request #1 from 8vasu/patch-1, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk 34c8588d7e 029/100: fix some issues involving multiline warnings, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk ad6dc99345 033/100: fix flycheck warnings, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk 7c3c45f924 041/100: fix "tab goes from compilation buffer to tex buffer" feature, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk a3af9c0f47 044/100: refactoring to make functions smaller, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk 776337f0d8 013/100: Fix the direction issue,
ELPA Syncer <=
- [elpa] externals/auctex-cont-latexmk 6d8252a759 014/100: avoid unnecessary "find-file-noselect", ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk 146dfe2350 019/100: Merge remote-tracking branch 'origin/main', ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk 08d713ef4b 017/100: improve handling of some failure cases, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk dc493bf00c 022/100: delete a couple lines that should have been deleted last time, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk 61cf12f244 032/100: for errors, just get line number directly, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk 549d8c06a7 034/100: got it in decent working shape, modulo an occasional error, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk 8b6924f833 038/100: fix typo and tweak README.org, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk 30694ac352 039/100: make TAB switch from compilation buffer back to tex file, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk ef4f329804 045/100: change description, ELPA Syncer, 2024/06/06
- [elpa] externals/auctex-cont-latexmk b208286d55 083/100: Add some tips to README, ELPA Syncer, 2024/06/06