[elpa] externals/auctex-cont-latexmk 447b9f3be2 018/100: add synctex to default options

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 447b9f3be2ffcce079fb61f323fb283e9f78a365
Author: Paul Nelson 
Commit: Paul Nelson 

add synctex to default options
---
 czm-tex-compile.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index f3a858bf0a..5553dfefa1 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -45,7 +45,7 @@
 (require 'esh-mode)
 
 (defcustom czm-tex-compile-command
-  "latexmk -shell-escape -pvc -pdf -view=none -e '$pdflatex=q/pdflatex %O 
-interaction=nonstopmode %S/'"
+  "latexmk -shell-escape -pvc -pdf -view=none -e '$pdflatex=q/pdflatex %O 
-synctex=1 -interaction=nonstopmode %S/'"
   "Command to compile LaTeX documents."
   :type 'string
   :group 'czm-tex-compile)



[elpa] externals/auctex-cont-latexmk e5cce65c36 040/100: readme tweaks

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit e5cce65c36d03013f80c9edf766ba42b162b99d9
Author: Paul Nelson 
Commit: Paul Nelson 

readme tweaks
---
 README.org | 23 ---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/README.org b/README.org
index 9cb1169ed5..3af9568d0e 100644
--- a/README.org
+++ b/README.org
@@ -8,8 +8,8 @@ This package provides a minor mode where 
[[https://ctan.org/pkg/latexmk?lang=en]
 Download this repository, install using =M-x package-install-file= (or 
package-vc-install, straight, elpaca, ...), and add something like the 
following to your [[https://www.emacswiki.org/emacs/InitFile][init file]]:
 #+begin_src elisp
 (use-package czm-tex-compile
-:bind
-("C-c k" . czm-tex-compile-toggle))
+  :bind
+  ("C-c k" . czm-tex-compile-toggle))
 #+end_src
 Replace the keybinding with whatever you prefer (or delete it and just run the 
command via =M-x=).
 
@@ -17,6 +17,23 @@ You can tweak the underlying =latexmk= command via =M-x 
customize-variable czm-t
 
 The command =czm-tex-compile-toggle= behaves the way that I prefer -- it 
enables both =czm-tex-compile-mode= and =flymake-mode=, restricting the 
backends for the latter to those coming from the former.  Depending upon your 
preferences, you may wish to write your own "wrapper" for 
=czm-tex-compile-mode= akin to =czm-tex-compile-toggle=.
 
-The way the Flymake backend works, it will update only when the latexmk 
process reaches a "watching for changes" state and the buffer is unmodified.  
The workflow is thus to save the file and then wait a few seconds before 
editing further, then to use Flymake to navigate the errors.  I also use =(setq 
flymake-show-diagnostics-at-end-of-line t)=, which displays the error/warning 
messages in the buffer itself.
+The way the Flymake backend works, it will update only when the latexmk 
process reaches a "watching for changes" state and the buffer is unmodified.  
The workflow is thus to save the file, wait a few seconds for the compilation 
to complete, and then to use Flymake to navigate the errors.  I configure 
Flymake to use =M-n= and =M-p= for navigation, and also use =(setq 
flymake-show-diagnostics-at-end-of-line t)=, which displays the error/warning 
messages in the buffer itself rather than jus [...]
+
+#+begin_src elisp
+(use-package flymake
+  :elpaca nil
+  :custom
+  (flymake-show-diagnostics-at-end-of-line t)
+  :bind
+  (:map flymake-mode-map
+("M-n" . flymake-goto-next-error)
+("M-p" . flymake-goto-prev-error)))
+
+(use-package czm-tex-compile
+  :elpaca (:host github :repo "ultronozm/czm-tex-compile.el"
+ :depth nil)
+  :bind
+  ("C-c k" . czm-tex-compile-toggle))
+#+end_src
 
 That's all.  I prefer this workflow to the alternative in which one compiles 
the document manually via =TeX-command-master= (=C-c C-c=) and navigates the 
warning/error messages using =next-error= (=M-n=) and =previous-error= (=M-p=). 
 It also gives a handy way to keep the .aux files up-to-date; I take advantage 
of this feature in the packages 
[[https://github.com/ultronozm/czm-preview.el][czm-preview.el]] and 
[[https://github.com/ultronozm/czm-tex-fold.el][czm-tex-fold.el]] to annotate t 
[...]



[elpa] externals/auctex-cont-latexmk 194e951633 023/100: Merge remote-tracking branch 'origin/main'

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 194e9516338afbee5e201fb43a981d6803f788d3
Merge: dc493bf00c dc130e1bfe
Author: Paul Nelson 
Commit: Paul Nelson 

Merge remote-tracking branch 'origin/main'
---
 README.org | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.org b/README.org
index f43bd2fce5..b7871545ad 100644
--- a/README.org
+++ b/README.org
@@ -1,4 +1,4 @@
-#+title: czm-preview.el: Convenience functions for compiling LaTeX
+#+title: czm-tex-compile.el: Convenience functions for compiling LaTeX
 #+author: Paul Nelson
 
 * Overview



[elpa] externals/auctex-cont-latexmk d377100af3 056/100: cleaning up, hopefully not ruining everything

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit d377100af3479421daf55f4876b75857b5802b5d
Author: Paul Nelson 
Commit: Paul Nelson 

cleaning up, hopefully not ruining everything
---
 czm-tex-compile.el | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 3d9886d374..2f077db3c0 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -207,6 +207,9 @@ latexmk compilation is in a \"Watching\" state."
 
 (defun czm-tex-compile--timer-function ()
   "Report to the flymake backend if the current buffer is fresh."
+  (dolist (datum (czm-tex-compile-process-log))
+(cl-assert (not (null (nth 2 datum))) nil
+   "Region is nil in datum: %S" datum))
   (when (and czm-tex-compile--report-fn (czm-tex-compile--fresh-p))
 (funcall
  czm-tex-compile--report-fn
@@ -217,9 +220,7 @@ latexmk compilation is in a \"Watching\" state."
(current-buffer) (car region) (cdr region)
(if error-p :error :warning)
description)))
-  (seq-filter
-   (lambda (datum) (not (null (nth 2 datum
-   (czm-tex-compile-process-log))
+  (czm-tex-compile-process-log)
 
 (defvar czm-tex-compile-mode)
 



[elpa] externals/auctex-cont-latexmk b5bd4c5257 024/100: indentation

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit b5bd4c52576a030c06783090f149e6f3befd90a4
Author: Paul Nelson 
Commit: Paul Nelson 

indentation
---
 czm-tex-compile.el | 75 +++---
 1 file changed, 38 insertions(+), 37 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 6989cb71bf..12c0233682 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -105,7 +105,8 @@ Used for navigating LaTeX warnings in the log file."
   "Helper function to navigate warnings in the log file.
 DIRECTION should be either \='next or \='previous."
   (let* ((tex-file (buffer-file-name))
-(log-file (concat (file-name-sans-extension tex-file) ".log"))
+(log-file (concat (file-name-sans-extension tex-file)
+   ".log"))
 (file-modification-time (nth 5 (file-attributes log-file)))
 (last-navigation-time (car czm-tex-compile--log-state))
 (log-pos (cdr czm-tex-compile--log-state))
@@ -114,47 +115,47 @@ DIRECTION should be either \='next or \='previous."
   (insert-file-contents log-file)
   (save-excursion)
   (if (or (null last-navigation-time)
-(time-less-p last-navigation-time file-modification-time))
-(goto-char (if (eq direction 'previous)
+ (time-less-p last-navigation-time file-modification-time))
+ (goto-char (if (eq direction 'previous)
  (point-max)
(point-min)))
-  (goto-char log-pos))
+   (goto-char log-pos))
   (let ((search-fn
-   (if (eq direction '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)
+   (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 (when (match-string 1)
+   (czm-tex-compile--paragraph-as-line)))
+   (if error-p
+   (progn
+ (save-excursion
+   (re-search-forward "^l\\.\\([0-9]+\\) " nil t)
+   (let ((line-number (when (match-string 1)
  (string-to-number (match-string 1
-  (line-prefix 
(buffer-substring-no-properties
-  
(point)
+ (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)
+ (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))
+   ;; (forward-line (if (eq direction 'previous) -1 1))
+   (setq log-pos (point))
 (setq-local czm-t

[elpa] externals/auctex-cont-latexmk d052e767e6 016/100: Add synctex=1 to default compile command

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit d052e767e6feeb0df91707b806451d300ed3af9a
Author: Paul Nelson 
Commit: Paul Nelson 

Add synctex=1 to default compile command
---
 czm-tex-compile.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 195d08b84d..2df2fd24aa 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -45,7 +45,7 @@
 (require 'esh-mode)
 
 (defcustom czm-tex-compile-command
-  "latexmk -shell-escape -pvc -pdf -view=none -e '$pdflatex=q/pdflatex %O 
-interaction=nonstopmode %S/'"
+  "latexmk -shell-escape -pvc -pdf -view=none -synctex=1 -e 
'$pdflatex=q/pdflatex %O -interaction=nonstopmode %S/'"
   "Command to compile LaTeX documents."
   :type 'string
   :group 'czm-tex-compile)



[elpa] externals/auctex-cont-latexmk 45bd7a6c32 012/100: switch back to previous reverse-direction style

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 45bd7a6c3245d190617fb223cb2136c3ef8f4732
Author: Paul Nelson 
Commit: Paul Nelson 

switch back to previous reverse-direction style
---
 czm-tex-compile.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 6f7786c60c..abd61469c6 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -146,8 +146,8 @@ DIRECTION should be either \='next or \='previous."
  (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))
+;; (forward-line -1)
+   (forward-line (if (eq direction 'previous) -1 1))

(setq log-pos (point))
 (unless already-open



[elpa] externals/auctex-cont-latexmk 826cf967f4 070/100: clarify commentary

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 826cf967f429cd82cf0529f0b91025ab62426919
Author: Paul Nelson 
Commit: Paul Nelson 

clarify commentary
---
 tex-continuous.el | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/tex-continuous.el b/tex-continuous.el
index 60582054b9..28d018eb9a 100644
--- a/tex-continuous.el
+++ b/tex-continuous.el
@@ -27,8 +27,13 @@
 ;; via latexmk, reporting errors via `flymake'.
 ;;
 ;; Use M-x tex-continuous-toggle to toggle the minor mode and set up
-;; flymake.  If you use flymake in tex documents for other reasons,
-;; then you should instead use M-x tex-continuous-mode.
+;; flymake.
+;;
+;; If you want to enable continuous compilation but prefer either not
+;; to use the flymake backend or to manage it yourself (e.g., in
+;; combination with our flymake backends), then instead use M-x
+;; tex-continuous-mode and add #'tex-continuous-flymake to
+;; flymake-diagnostic-functions when you'd like.
 ;;
 ;; Customize the variable `tex-continuous-command' to change the
 ;; compilation command.



[elpa] externals/auctex-cont-latexmk d0fe19c0de 079/100: Make tex-continuous-mode independent of flymake

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit d0fe19c0dee67291e44d8fa37082ceff89264b60
Author: Paul Nelson 
Commit: Paul Nelson 

Make tex-continuous-mode independent of flymake

* tex-continuous.el (tex-continuous-mode): Remove flymake hook
adjustments.  These are now taken care of either by the user, or by
tex-continuous-toggle.
---
 tex-continuous.el | 2 --
 1 file changed, 2 deletions(-)

diff --git a/tex-continuous.el b/tex-continuous.el
index 20d0e52629..16cc1f332a 100644
--- a/tex-continuous.el
+++ b/tex-continuous.el
@@ -294,7 +294,6 @@ report diagnostics."
   (add-hook 'after-change-functions #'tex-continuous--update-time nil 
t)
   (push buf tex-continuous--subscribed-buffers
 (add-hook 'kill-buffer-hook 'tex-continuous--unsubscribe nil t)
-(add-hook 'flymake-diagnostic-functions #'tex-continuous-flymake nil t)
 (when tex-continuous--timer
   (cancel-timer tex-continuous--timer)
   (setq tex-continuous--timer nil))
@@ -303,7 +302,6 @@ report diagnostics."
(t
 (tex-continuous--unsubscribe)
 (remove-hook 'kill-buffer-hook 'tex-continuous--unsubscribe t)
-(remove-hook 'flymake-diagnostic-functions #'tex-continuous-flymake t)
 (when tex-continuous--report-fn
   (setq tex-continuous--report-fn nil)
 



[elpa] externals/auctex-cont-latexmk 43bdc08cf6 071/100: formatting

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 43bdc08cf66331f2ab2e674670f79c97e6764110
Author: Paul Nelson 
Commit: Paul Nelson 

formatting
---
 tex-continuous.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tex-continuous.el b/tex-continuous.el
index 28d018eb9a..85b247e918 100644
--- a/tex-continuous.el
+++ b/tex-continuous.el
@@ -295,7 +295,8 @@ report diagnostics."
 (message "tex-continuous-mode and flymake-mode disabled"))
(t
 (tex-continuous-mode 1)
-(setq tex-continuous--saved-flymake-diagnostic-functions 
flymake-diagnostic-functions)
+(setq tex-continuous--saved-flymake-diagnostic-functions
+  flymake-diagnostic-functions)
 (setq-local flymake-diagnostic-functions '(tex-continuous-flymake t))
 (flymake-mode 1)
 (message "tex-continuous-mode and flymake-mode enabled"



[elpa] externals/auctex-cont-latexmk c3ff2df047 030/100: restrict errors to those associated to some file

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit c3ff2df04731783b831c42285d7b3e95d1fdd7d7
Author: Paul Nelson 
Commit: Paul Nelson 

restrict errors to those associated to some file
---
 czm-tex-compile.el | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index bb665b91b2..62d1fabe83 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -112,8 +112,10 @@ Used for navigating LaTeX warnings in the log file."
 TeX-error-list))
  (filtered (seq-filter
 (lambda (item)
-  (equal (expand-file-name (nth 1 item))
- (expand-file-name tex-file)))
+  (and
+   (stringp (nth 1 item))
+   (equal (expand-file-name (nth 1 item))
+  (expand-file-name tex-file
 error-list))
  (stuff (mapcar
  (lambda (item)



[elpa] externals/auctex-cont-latexmk e20b97607e 026/100: got it in OK shape, still quite rough tho

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit e20b97607eb6f3d66cdd7e01a9b2c4b71b80e1d6
Author: Paul Nelson 
Commit: Paul Nelson 

got it in OK shape, still quite rough tho
---
 czm-tex-compile.el | 186 +
 1 file changed, 74 insertions(+), 112 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 8dd9a87a57..0c370c950c 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -72,6 +72,7 @@ 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)
   (if (get-buffer bufname)
  (switch-to-buffer bufname)
(save-window-excursion
@@ -98,113 +99,46 @@ Used for navigating LaTeX warnings in the log file."
 ;; line numbers found in log entries beyond that point (just display
 ;; them).
 
-(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."
-  (let* ((tex-file (buffer-file-name))
-(log-file (concat (file-name-sans-extension tex-file)
-   ".log"))
-(file-modification-time (nth 5 (file-attributes log-file)))
-(last-navigation-time (car czm-tex-compile--log-state))
-(log-pos (cdr czm-tex-compile--log-state))
-line description)
-(with-temp-buffer
-  (insert-file-contents log-file)
-  (save-excursion)
-  (if (or (null last-navigation-time)
- (time-less-p last-navigation-time file-modification-time))
- (goto-char (if (eq direction 'previous)
- (point-max)
-   (point-min)))
-   (goto-char log-pos))
-  (let ((search-fn
-(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 (when (match-string 1)
- (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-local czm-tex-compile--log-state (cons last-navigation-time log-pos))
-(when line
-  (let ((pos
- (save-excursion
-   (save-restriction
- (goto-char (point-min))
- (when-let ((line-number
- (if (consp line)
- (car line)
-   line)))
-   (forward-line (1- line-number)))
- (when (consp line)
-   (when-let* ((search-string (cdr line))
-  (truncated-search-string
-   (if (< (length search-string)
-   3)
-   search-string
- (substring search-string 3
-(search-forward truncated-search-string nil t)))
- (point)
-(unless (<= (point-min)
-pos (point-max))
-  (widen))
-(goto-char pos)
-(recenter)))
-(message
- (concat (or description "No further errors or warnings.")
- (when czm-tex-compile--debug
-   " -- "
-   (format "%s" (cdr czm-tex-compile--log-state)))
-
+(defun czm-tex-compile--log-parent ()
+  (beginning-of-line)
+  (let ((tally 0)
+(found nil))
+(while (

[elpa] externals/auctex-cont-latexmk ae9171666e 063/100: tidy

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit ae9171666e2508485093236734e46b9e1fd6211a
Author: Paul Nelson 
Commit: Paul Nelson 

tidy
---
 czm-tex-compile.el | 50 ++
 1 file changed, 22 insertions(+), 28 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 35c54ff941..6858c5f3a1 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -45,18 +45,12 @@
   "Run latexmk continuously, report errors via flymake."
   :group 'tex)
 
-(defcustom czm-tex-compile-command
-  "latexmk -pvc -shell-escape -pdf -view=none -e '$pdflatex=q/pdflatex %O 
-synctex=1 -interaction=nonstopmode %S/'"
-  "Command to compile LaTeX documents."
-  :type 'string
-  :group 'czm-tex-compile)
-
 (defcustom czm-tex-compile-report-multiple-labels t
   "Non-nil means report multiple label errors via flymake."
   :type 'boolean
   :group 'czm-tex-compile)
 
-(defun czm-tex-compile-process-item (type file line message offset context 
search-string
+(defun czm-tex-compile-process-item (type file line message offset _context 
search-string
   _line-end bad-box _error-point 
ignore)
   "Process an error or warning for the current TeX document.
 The arguments are as in in `TeX-error-list'.  Return either nil or a
@@ -117,10 +111,8 @@ the triple describe the error or warning."
 
 (defun czm-tex-compile-process-log ()
   "Process log file for current LaTeX document.
-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."
+Return a list of triples as in the docstring of
+`czm-tex-compile-process-item'."
   (delq nil (mapcar (lambda (item)
   (apply #'czm-tex-compile-process-item item))
 (czm-tex-compile--error-list (TeX-master-file "log")
@@ -159,14 +151,24 @@ latexmk compilation is in a \"Watching\" state."
  (time-less-p (nth 5 (file-attributes file))
   (nth 5 (file-attributes log-file))
 
+(defvar czm-tex-compile-mode)
+
 (defvar-local czm-tex-compile--report-fn nil
   "Function provided by Flymake for reporting diagnostics.")
 
-(defvar-local czm-tex-compile--timer-enabled nil)
+(defun czm-tex-compile-flymake (report-fn &rest _args)
+  "Flymake backend for LaTeX based on latexmk.
+Save REPORT-FN in a local variable, called by
+e`czm-tex-compile--timer' to report diagnostics."
+  (when czm-tex-compile-mode
+(setq czm-tex-compile--report-fn report-fn)))
+
+(defvar czm-tex-compile--timer nil
+  "Timer for reporting changes to the log file.")
 
 (defun czm-tex-compile--timer-function ()
   "Report to the flymake backend if the current buffer is fresh."
-  (when czm-tex-compile--timer-enabled
+  (when czm-tex-compile-mode
 (when (and czm-tex-compile--report-fn (czm-tex-compile--fresh-p))
   (funcall
czm-tex-compile--report-fn
@@ -179,15 +181,6 @@ latexmk compilation is in a \"Watching\" state."
  description)))
 (czm-tex-compile-process-log))
 
-(defvar czm-tex-compile-mode)
-
-(defun czm-tex-compile-flymake (report-fn &rest _args)
-  "Flymake backend for LaTeX based on latexmk.
-Save REPORT-FN in a local variable, called by
-e`czm-tex-compile--timer' to report diagnostics."
-  (when czm-tex-compile-mode
-(setq czm-tex-compile--report-fn report-fn)))
-
 (defvar-local czm-tex-compile--subscribed-buffers nil
   "List of buffers subscribed to the current LaTeX compilation.")
 
@@ -210,13 +203,16 @@ e`czm-tex-compile--timer' to report diagnostics."
 (delete-process process))
   (kill-buffer comp-buf))
 
+(defcustom czm-tex-compile-command
+  "latexmk -pvc -shell-escape -pdf -view=none -e '$pdflatex=q/pdflatex %O 
-synctex=1 -interaction=nonstopmode %S/'"
+  "Command to compile LaTeX documents."
+  :type 'string
+  :group 'czm-tex-compile)
+
 (defun czm-tex-compile--compilation-command ()
   "Return the command used to compile the current LaTeX document."
   (format "%s %s" czm-tex-compile-command (TeX-master-file "tex")))
 
-(defvar czm-tex-compile--timer nil
-  "Timer for reporting changes to the log file.")
-
 ;;;###autoload
 (define-minor-mode czm-tex-compile-mode
   "If enabled, run LaTeX compilation on the current buffer."
@@ -241,13 +237,11 @@ e`czm-tex-compile--timer' to report diagnostics."
   (cancel-timer czm-tex-compile--timer)
   (setq czm-tex-compile--timer nil))
 (setq czm-tex-compile--timer
-  (run-with-timer 2 1 #'czm-tex-compile--timer-function))
-(setq czm-tex-compile--timer-enabled t))
+  (run-with-timer 2 1 #'czm-tex-compile--timer-function)))
(t
 (czm-tex-compile--unsubscribe)
 (remove-hook 'kill-buffer-hook 'czm-tex-compile--unsubscribe t)
 (remove-hook 'flymake-diagnostic-functions #'czm-tex-compile-flymake t)
-(setq czm-tex-compile--timer-enabled

[elpa] externals/auctex-cont-latexmk 962365441a 005/100: Update czm-tex-compile.el

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 962365441a152d8fc5b3a35bcd8ea8f288397881
Author: Paul Nelson 
Commit: Paul Nelson 

Update czm-tex-compile.el
---
 czm-tex-compile.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 59f3b9314a..dc17f09c93 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2023  Paul D. Nelson
 
 ;; Author: Paul D. Nelson 
-;; Version: 0.1
+;; Version: 0.0
 ;; URL: https://github.com/ultronozm/czm-tex-compile.el
 ;; Package-Requires: ((emacs "29.1") (auctex "11.86.1"))
 ;; Keywords: tex



[elpa] externals/auctex-cont-latexmk fcb2ec2d87 062/100: tidy

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit fcb2ec2d876f2eaa89e22efdee7b21a486e64a48
Author: Paul Nelson 
Commit: Paul Nelson 

tidy
---
 czm-tex-compile.el | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 68fac26010..35c54ff941 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -42,7 +42,7 @@
 (require 'flymake)
 
 (defgroup czm-tex-compile nil
-  "Convenience functions for compiling LaTeX documents."
+  "Run latexmk continuously, report errors via flymake."
   :group 'tex)
 
 (defcustom czm-tex-compile-command
@@ -51,14 +51,6 @@
   :type 'string
   :group 'czm-tex-compile)
 
-(defvar-local czm-tex-compile--report-fn nil
-  "Function provided by Flymake for reporting diagnostics.")
-
-(defvar-local czm-tex-compile--timer-enabled nil)
-
-(defvar czm-tex-compile--timer nil
-  "Timer for reporting changes to the log file.")
-
 (defcustom czm-tex-compile-report-multiple-labels t
   "Non-nil means report multiple label errors via flymake."
   :type 'boolean
@@ -167,6 +159,11 @@ latexmk compilation is in a \"Watching\" state."
  (time-less-p (nth 5 (file-attributes file))
   (nth 5 (file-attributes log-file))
 
+(defvar-local czm-tex-compile--report-fn nil
+  "Function provided by Flymake for reporting diagnostics.")
+
+(defvar-local czm-tex-compile--timer-enabled nil)
+
 (defun czm-tex-compile--timer-function ()
   "Report to the flymake backend if the current buffer is fresh."
   (when czm-tex-compile--timer-enabled
@@ -217,6 +214,9 @@ e`czm-tex-compile--timer' to report diagnostics."
   "Return the command used to compile the current LaTeX document."
   (format "%s %s" czm-tex-compile-command (TeX-master-file "tex")))
 
+(defvar czm-tex-compile--timer nil
+  "Timer for reporting changes to the log file.")
+
 ;;;###autoload
 (define-minor-mode czm-tex-compile-mode
   "If enabled, run LaTeX compilation on the current buffer."



[elpa] externals/auctex-cont-latexmk a769d92a2c 100/100: rename: tex-continuous -> auctex-cont-latexmk

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit a769d92a2c1c4eb21f972cd252a8d267dee72ba2
Author: Paul Nelson 
Commit: Paul Nelson 

rename: tex-continuous -> auctex-cont-latexmk
---
 README.org |  12 +--
 auctex-cont-latexmk.el | 270 -
 2 files changed, 141 insertions(+), 141 deletions(-)

diff --git a/README.org b/README.org
index 0b4a80544d..043caeab20 100644
--- a/README.org
+++ b/README.org
@@ -1,4 +1,4 @@
-#+title: tex-continuous.el: run latexmk continuously, report errors via flymake
+#+title: auctex-cont-latexmk.el: run latexmk continuously, report errors via 
flymake
 #+author: Paul Nelson
 
 * Overview
@@ -7,15 +7,15 @@ This package provides a minor mode where 
[[https://ctan.org/pkg/latexmk?lang=en]
 * Configuration and usage
 Download this repository, install using =M-x package-install-file= (or 
package-vc-install, straight, elpaca, ...), and add something like the 
following to your [[https://www.emacswiki.org/emacs/InitFile][init file]]:
 #+begin_src elisp
-(use-package tex-continuous
+(use-package auctex-cont-latexmk
   :after latex
   :bind
   (:map LaTeX-mode-map
-("C-c k" . tex-continuous-toggle)))
+("C-c k" . auctex-cont-latexmk-toggle)))
 #+end_src
 Replace the keybinding with whatever you prefer (or delete it and just run the 
command via =M-x=).
 
-The command =tex-continuous-toggle= behaves the way that I prefer -- it 
enables both =tex-continuous-mode= and =flymake-mode=, restricting the backends 
for the latter to those coming from the former.  If you want to use continuous 
compilation but no flymake, then you might instead wish to bind a key to 
=tex-continuous-mode= or simply do =M-x tex-continuous-mode=.  If you already 
use flymake for something else in tex buffers, then you might wish to write 
your own "wrapper" for =tex-contin [...]
+The command =auctex-cont-latexmk-toggle= behaves the way that I prefer -- it 
enables both =auctex-cont-latexmk-mode= and =flymake-mode=, restricting the 
backends for the latter to those coming from the former.  If you want to use 
continuous compilation but no flymake, then you might instead wish to bind a 
key to =auctex-cont-latexmk-mode= or simply do =M-x auctex-cont-latexmk-mode=.  
If you already use flymake for something else in tex buffers, then you might 
wish to write your own "wrap [...]
 
 The way the Flymake backend works, it will update only when the latexmk 
process reaches a "watching for changes" state and the buffer is unmodified.  
The workflow is thus to save the file, wait a few seconds for the compilation 
to complete, and then to use Flymake to navigate the errors.  I configure 
Flymake to use =M-n= and =M-p= for navigation, and also use =(setq 
flymake-show-diagnostics-at-end-of-line t)= (available in Flymake 1.3.6, part 
of Emacs 30+), which displays the error/warni [...]
 
@@ -35,10 +35,10 @@ That's all.  I prefer this workflow to the alternative in 
which one compiles the
 
 * Tips
 - TeX compilers are not so good at locating errors involving braces.  For 
this, the Emacs commands =check-parens=, =tex-validate-buffer= and 
=tex-validate-region= are indispensable.  In particular, you should always try 
these commands when you encounter errors at the bottom of a file concerning an 
incomplete argument or environment.
-- You can use the command =M-x tex-continuous-help-at-point= (or bind it to a 
key) if you want to see AUCTeX's help message (if any) for the error at point.
+- You can use the command =M-x auctex-cont-latexmk-help-at-point= (or bind it 
to a key) if you want to see AUCTeX's help message (if any) for the error at 
point.
 
 * Customization
-- You can tweak the underlying =latexmk= command via =M-x customize-variable 
tex-continuous-command=.
+- You can tweak the underlying =latexmk= command via =M-x customize-variable 
auctex-cont-latexmk-command=.
 - This package respects the AUCTeX variable =TeX-output-dir=: you can use that 
variable to control where the output files generated via latexmk are placed.
 
 * Troubleshooting
diff --git a/auctex-cont-latexmk.el b/auctex-cont-latexmk.el
index bb7a557465..37b4bcc475 100644
--- a/auctex-cont-latexmk.el
+++ b/auctex-cont-latexmk.el
@@ -1,10 +1,10 @@
-;;; tex-continuous.el --- run latexmk continuously, report errors via Flymake  
-*- lexical-binding: t; -*-
+;;; auctex-cont-latexmk.el --- run latexmk continuously, report errors via 
Flymake  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2023  Paul D. Nelson
 
 ;; Author: Paul D. Nelson 
 ;; Version: 0.1
-;; URL: https://github.com/ultronozm/tex-continuous.el
+;; URL: https://github.com/ultronozm/auctex-cont-latexmk.el
 ;; Package-Requires: ((emacs "29.3") (auctex "14.0.5"))
 ;; Keywords: tex
 
@@ -26,16 +26,16 @@
 ;; This package provides a minor mode that compiles a LaTeX document
 ;; via latexmk, reporting errors via `flymake'.
 ;;
-;; Use `tex-continuous-toggle' to toggle the minor mode and set up
-;; Flymake.
+;; Use `auctex-cont-

[elpa] externals/auctex-cont-latexmk febe275533 003/100: Add autoloads

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit febe27553319bff4dbe60afc67f68cfda99a7c54
Author: Paul Nelson 
Commit: Paul Nelson 

Add autoloads
---
 czm-tex-compile.el | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 673cad2199..d8d73034e4 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -3,6 +3,9 @@
 ;; Copyright (C) 2023  Paul D. Nelson
 
 ;; Author: Paul D. Nelson 
+;; Version: 0.1
+;; URL: https://github.com/ultronozm/czm-tex-compile.el
+;; Package-Requires: ((emacs "29.1") (auctex "11.86.1"))
 ;; Keywords: tex
 
 ;; This program is free software; you can redistribute it and/or modify
@@ -24,7 +27,7 @@
 
 ;;; Code:
 
-
+;;;###autoload
 (defun czm-latexmk-this ()
   (interactive)
   (if (string-match "\\([^\.]+\\)\.tex" (buffer-name))
@@ -151,11 +154,13 @@ DIRECTION should be either 'next or 'previous."
(goto-line line)))
 (message (or description "No further errors or warnings."
 
+;;;###autoload
 (defun czm/latex-previous-log-error ()
   "Move point to the previous LaTeX-warning line."
   (interactive)
   (czm/latex-navigate-log-error 'previous))
 
+;;;###autoload
 (defun czm/latex-next-log-error ()
   "Move point to the next LaTeX-warning line."
   (interactive)



[elpa] externals/auctex-cont-latexmk a3ba987e68 074/100: add tex-continuous--build-file back in, at least for now

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit a3ba987e68803ce7c23a3d6b34da4a93153c0051
Author: Paul Nelson 
Commit: Paul Nelson 

add tex-continuous--build-file back in, at least for now
---
 tex-continuous.el | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/tex-continuous.el b/tex-continuous.el
index a72e248541..9435a6b691 100644
--- a/tex-continuous.el
+++ b/tex-continuous.el
@@ -83,6 +83,16 @@ file."
  " "
  (shell-quote-argument (TeX-master-file "tex")
 
+(defun tex-continuous--build-file (ext)
+  "Return the build file with extension EXT.
+Takes into account `TeX-output-dir'."
+  (if TeX-output-dir
+  (let ((master-dir (TeX-master-directory)))
+(concat (or (TeX--master-output-dir master-dir t)
+master-dir)
+(file-name-nondirectory (TeX-master-file ext
+(TeX-master-file ext)))
+
 (defun tex-continuous-process-item (type file line message offset _context
  search-string _line-end bad-box
  _error-point ignore)



[elpa] externals/auctex-label-numbers 38f3bc735d 10/12: fix regexp pattern

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-label-numbers
commit 38f3bc735d83c340664d5dfbd0931fe733bbdd8a
Author: Paul Nelson 
Commit: Paul Nelson 

fix regexp pattern

"\\n" matches "n", so the error didn't actually affect functionality
---
 tex-numbers.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tex-numbers.el b/tex-numbers.el
index 81b99d9418..8c6e7d51de 100644
--- a/tex-numbers.el
+++ b/tex-numbers.el
@@ -53,7 +53,7 @@ Return the updated cache, or nil if the aux file does not 
exist."
 (with-temp-buffer
   (insert-file-contents aux-file)
   (let ((cache (make-hash-table :test 'equal))
-(pattern "\\newlabel{\\([^}]+\\)}{{\\([^}]+\\)}"))
+(pattern "newlabel{\\([^}]+\\)}{{\\([^}]+\\)}"))
 (save-excursion
   (goto-char (point-min))
   (while (re-search-forward pattern nil t)



[elpa] externals/auctex-cont-latexmk 9ffc065182 042/100: add support for flagging multiply-defined labels and bad boxes

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 9ffc06518273a15be50ebafc5c46ee6a5e8b1f33
Author: Paul Nelson 
Commit: Paul Nelson 

add support for flagging multiply-defined labels and bad boxes
---
 czm-tex-compile.el | 132 -
 1 file changed, 69 insertions(+), 63 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index f8c083934c..79d15cb18a 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -95,7 +95,7 @@
   (cancel-timer czm-tex-compile--log-watch-timer)
   (setq czm-tex-compile--log-watch-timer nil))
 (setq czm-tex-compile--log-watch-timer
-  (run-with-timer 1 1 #'czm-tex-compile-report-if-fresh)))
+  (run-with-timer 2 1 #'czm-tex-compile-report-if-fresh)))
 (czm-tex-compile--kill-process)
 (when czm-tex-compile--report-fn
   (setq czm-tex-compile--report-fn nil
@@ -136,6 +136,16 @@ Also kill the timer for watching the log file."
 
 (require 'tex)
 
+(defcustom czm-tex-compile-report-hbox-errors nil
+  "Non-nil means report hbox errors via flymake."
+  :type 'boolean
+  :group 'czm-tex)
+
+(defcustom czm-tex-compile-report-multiple-labels t
+  "Non-nil means report multiple label errors via flymake."
+  :type 'boolean
+  :group 'czm-tex)
+
 (defun czm-tex-compile-process-log ()
   "Process log file for current LaTeX document.
 Returns a list of triples (ERROR-P DESCRIPTION REGION), where
@@ -144,76 +154,72 @@ 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")))
+ (log-file (concat (file-name-sans-extension tex-file) ".log")))
 (with-temp-buffer
   (insert-file-contents log-file)
   (goto-char (point-min))
   (while (re-search-forward "Warning:" nil t)
-;; make it all appear on one line
 (end-of-line)
 (while (not (looking-at "\n\n"))
   (delete-char 1)
   (end-of-line)))
-  (let* ((error-list (progn (TeX-parse-all-errors)
-TeX-error-list))
- (filtered (seq-filter
-(lambda (item)
-  (and
-   (stringp (nth 1 item))
-   (equal (expand-file-name (nth 1 item))
-  (expand-file-name tex-file
-error-list))
- (stuff (mapcar
- (lambda (item)
-   (let* ((error-p (eq (nth 0 item)
-   'error))
-  (description-raw (nth (if error-p 3 5)
-item))
-  (description (if error-p description-raw
- (substring description-raw
-0
-;; (progn 
(string-match " Warning: " description-raw)
-;;(match-end 
0))
--1)))
-  line prefix)
- (if error-p
- (with-temp-buffer
-   (insert (nth 5 item))
-   (goto-char (point-min))
-   (setq line (nth 2 item))
-   (when (re-search-forward "\nl\\.\\([0-9]+\\) " 
nil t)
-  (setq prefix 
(buffer-substring-no-properties (point)
-  
(line-end-position)
- (when (string-match "input line \\([0-9]+\\)" 
description)
-   (setq line (string-to-number (match-string 
1 description)
- (list
-  error-p
-  (replace-regexp-in-string
-   "\n" ""
-   description)
-  (when line
-(if prefix
-(let ((pos
-   (with-current-buffer current-buf
- (save-excursion
-   (save-restriction
- (widen)
- (goto-char (point-min))
- (forward-line (1- line))
- ;; should probably just delete any
- ;; "..." at b

[elpa] externals/auctex-cont-latexmk c1aa3aafe1 047/100: first attempt at fixing narrowing issues

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit c1aa3aafe1e0e3116df920c0fdc7f3fc6c6fbdc8
Author: Paul Nelson 
Commit: Paul Nelson 

first attempt at fixing narrowing issues
---
 czm-tex-compile.el | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index e752fc70a1..9141eceb05 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -197,8 +197,12 @@ nil if the error is not found."
(let ((truncated-prefix
   (substring prefix
  (max 0 (- (length prefix)
-   3)
- (search-forward truncated-prefix nil t)))
+   3
+ (line-end (line-end-position))
+ (bol (point)))
+ (or
+  (search-forward truncated-prefix line-end t)
+  bol)))
 (when pos
   (cons pos (1+ pos)))
 



[elpa] externals/auctex-cont-latexmk 7e2cbfbc88 046/100: fix defcustom groups

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 7e2cbfbc8872b650d88648fc323f61728328d507
Author: Paul Nelson 
Commit: Paul Nelson 

fix defcustom groups
---
 czm-tex-compile.el | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 1527c5e6d8..e752fc70a1 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -47,7 +47,8 @@
 (defcustom czm-tex-compile-command
   "latexmk -shell-escape -pvc -pdf -view=none -e '$pdflatex=q/pdflatex %O 
-synctex=1 -interaction=nonstopmode %S/'"
   "Command to compile LaTeX documents."
-  :type 'string)
+  :type 'string
+  :group 'czm-tex-compile)
 
 (defvar-local czm-tex-compile--process nil
   "Process running the LaTeX compilation.")
@@ -139,12 +140,12 @@ Also kill the timer for watching the log file."
 (defcustom czm-tex-compile-report-hbox-errors nil
   "Non-nil means report hbox errors via flymake."
   :type 'boolean
-  :group 'czm-tex)
+  :group 'czm-tex-compile)
 
 (defcustom czm-tex-compile-report-multiple-labels t
   "Non-nil means report multiple label errors via flymake."
   :type 'boolean
-  :group 'czm-tex)
+  :group 'czm-tex-compile)
 
 
 (defun czm-tex-compile--parse-log-buffer (log-file)



[elpa] externals/auctex-cont-latexmk 27c1ef5c71 002/100: Add files via upload

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 27c1ef5c71f4cf1d10272f80b1900980f59de948
Author: Paul Nelson <63298781+ultron...@users.noreply.github.com>
Commit: GitHub 

Add files via upload
---
 czm-tex-compile.el | 165 +
 1 file changed, 165 insertions(+)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
new file mode 100644
index 00..673cad2199
--- /dev/null
+++ b/czm-tex-compile.el
@@ -0,0 +1,165 @@
+;;; czm-tex-compile.el --- Convenience functions compiling LaTeX  -*- 
lexical-binding: t; -*-
+
+;; Copyright (C) 2023  Paul D. Nelson
+
+;; Author: Paul D. Nelson 
+;; Keywords: tex
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see .
+
+;;; Commentary:
+
+;; Convenience functions for compiling LaTeX.  Under construction.
+
+;;; Code:
+
+
+(defun czm-latexmk-this ()
+  (interactive)
+  (if (string-match "\\([^\.]+\\)\.tex" (buffer-name))
+  (let ((name (match-string 1 (buffer-name
+   (let ((bufname (concat "*eshell-" name "*")))
+ (if (get-buffer bufname)
+ (switch-to-buffer bufname)
+   (save-window-excursion
+ (eshell "new")
+ (rename-buffer bufname)
+ (insert (concat "latexmk -shell-escape -pvc -pdf -view=none " 
name ".tex"))
+ (eshell-send-input)))
+
+(defun my-latexmk-this ()
+  (interactive)
+  (if (string-match "\\([^\.]+\\)\.tex" (buffer-name))
+  (let ((name (match-string 1 (buffer-name)))
+(default-directory (file-name-directory (buffer-file-name
+(let ((bufname (concat "*latexmk-" name "*")))
+  (with-current-buffer (get-buffer-create bufname)
+(compilation-start (format "latexmk -shell-escape -pvc -pdf 
-view=none %s.tex" name) 'compilation-mode)
+(display-buffer bufname))
+
+(defun my-latexmk-this ()
+  (interactive)
+  (if (string-match "\\([^\.]+\\)\.tex" (buffer-name))
+  (let ((name (match-string 1 (buffer-name)))
+(default-directory (file-name-directory (buffer-file-name
+(let ((bufname (concat "*latexmk-" name "*")))
+  (with-current-buffer (get-buffer-create bufname)
+(unless (eq major-mode 'compilation-mode)
+  (compilation-mode))
+(compilation-start (format "latexmk -shell-escape -pvc -pdf 
-view=none %s.tex" name) nil
+   (lambda (_mode-name) bufname))
+(display-buffer bufname)
+(local-set-key (kbd "x") 'my-kill-compilation))
+
+(defun my-kill-compilation ()
+  "Kill the current compilation process."
+  (interactive)
+  (when (get-buffer-process (current-buffer))
+(interrupt-process (get-buffer-process (current-buffer)))
+(message "Compilation process killed.")))
+
+;; Maybe improve this at some point using the following:
+;; (let ((entry (save-excursion
+;;  (bibtex-beginning-of-entry)
+;;  (bibtex-parse-entry
+;;   (cdr (assoc "=key=" entry))
+
+(defun my-paragraph-as-line ()
+  (interactive)
+  (let ((beg (point))
+   (end (save-excursion
+  (forward-paragraph)
+  (point
+(replace-regexp-in-string "\n" "" (buffer-substring-no-properties beg 
end
+
+(defvar-local czm/latex-log-state nil
+  "Buffer-local variable with a cons containing last navigation time and log 
file position.")
+
+(defun czm/latex-navigate-log-error (direction)
+  "Helper function to navigate warnings in the log file.
+DIRECTION should be either 'next or 'previous."
+  (let* ((tex-file (buffer-file-name))
+(log-file (concat (file-name-sans-extension tex-file) ".log"))
+(already-open (find-buffer-visiting log-file))
+(buf (or already-open (find-file-noselect log-file)))
+(file-modification-time (nth 5 (file-attributes log-file)))
+(last-navigation-time (car czm/latex-log-state))
+(log-pos (cdr czm/latex-log-state))
+line description)
+(with-current-buffer buf
+  (save-excursion)
+  (if (or (null last-navigation-time)
+ (time-less-p last-navigation-time file-modification-time))
+ (goto-char (if (eq direction 'previous) (point-max) (point-min)))
+   (goto-char log-pos))
+  (let ((search-fn
+(if (eq direction 'previous) #'re-search-backward 
#'re-search-forward)))
+   (when (funcall sear

[elpa] externals/auctex-cont-latexmk acfaf552b7 011/100: Add .html to .gitignore

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit acfaf552b7aad3569009e199009592bcbc266ef8
Author: Paul Nelson 
Commit: Paul Nelson 

Add .html to .gitignore
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
index 206569dc66..7ab62451bb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,4 @@
 
 # Undo-tree save-files
 *.~undo-tree
+/*.html



[elpa] externals/auctex-label-numbers 4a53df7fce 06/12: simplify capf label annotation using advice

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-label-numbers
commit 4a53df7fce1d040ce3ff9d4fa1aedd7560dc2ea8
Author: Paul Nelson 
Commit: Paul Nelson 

simplify capf label annotation using advice
---
 tex-numbers.el | 72 +-
 1 file changed, 31 insertions(+), 41 deletions(-)

diff --git a/tex-numbers.el b/tex-numbers.el
index cd89eed0ef..8546b175bc 100644
--- a/tex-numbers.el
+++ b/tex-numbers.el
@@ -24,11 +24,15 @@
 ;;; Commentary:
 
 ;; This package augments the preview and folding features of AUCTeX:
-;; previews of labeled equations are numbered as in the compiled
-;; document, and the the macros \\ref, \\eqref, and \\label are folded
-;; with the corresponding numbers.
 ;;
-;; Install via TODO.
+;; - Previews of labeled equations are numbered as in the compiled
+;;   document.
+;;
+;; - The the macros \\ref, \\eqref, and \\label are folded with the
+;;   corresponding numbers.
+;;
+;; - completion-at-point annotations for the contents of \\ref and
+;;   \\eqref include equation numbers.
 ;;
 ;; TEMPORARY NOTE: this package currently only works with the master
 ;; branch of AUCTeX.  The more elaborate package
@@ -88,6 +92,17 @@ Return the updated cache, or nil if the aux file does not 
exist."
 (puthash aux-file cache tex-numbers-cache)
 cache
 
+(defcustom tex-numbers-label-to-number-function nil
+  "Function to retrieve label numbers.
+If non-nil, `tex-numbers-label-to-number' delegates to this function.
+The function should take a label string as its argument and return the
+corresponding label number as a string, or nil if that number cannot be
+retrieved."
+  :type '(choice (const :tag "Default" nil) function))
+
+(defconst tex-numbers--external-document-regexp
+  "external\\(?:cite\\)?document\\(?:\\[[^]]+\\]\\)\\{0,2\\}{\\([^}]+\\)}")
+
 (defun tex-numbers-label-to-number-helper (label aux-file)
   "Get the number of LABEL from the AUX-FILE.
 Check the cache first, and update it if AUX-FILE has changed.  Return
@@ -100,36 +115,6 @@ the label number as a string, or nil if the label cannot 
be found."
 (when cache
   (gethash label cache
 
-(defun tex-numbers-label-annotation-function (label)
-  "Return context for LABEL, augmented by the corresponding label number."
-  (concat
-   (LaTeX-completion-label-annotation-function label)
-   (when-let ((number (tex-numbers-label-to-number label)))
- (format " (%s)" number
-
-(defvar tex-numbers-mode)
-
-(defun tex-numbers-completion-at-point ()
-  "Complete a label at point, with label numbers."
-  (if tex-numbers-mode
-  (when-let ((completion (TeX--completion-at-point)))
-(let ((props (nthcdr 3 completion)))
-  (plist-put props :annotation-function
- #'tex-numbers-label-annotation-function))
-completion)
-(TeX--completion-at-point)))
-
-(defcustom tex-numbers-label-to-number-function nil
-  "Function to retrieve label numbers.
-If non-nil, `tex-numbers-label-to-number' delegates to this function.
-The function should take a label string as its argument and return the
-corresponding label number as a string, or nil if that number cannot be
-retrieved."
-  :type '(choice (const :tag "Default" nil) function))
-
-(defconst tex-numbers--external-document-regexp
-  "external\\(?:cite\\)?document\\(?:\\[[^]]+\\]\\)\\{0,2\\}{\\([^}]+\\)}")
-
 (defun tex-numbers-label-to-number (label)
   "Get number of LABEL for current tex buffer.
 If the buffer does not point to a file, or if the corresponding
@@ -150,7 +135,8 @@ with \"X\"."
  (goto-char (point-min))
  (let (found)
(while (and (null found)
-   (re-search-forward "externaldocument{\\([^}]+\\)}" 
nil t))
+   (re-search-forward tex-numbers--external-document-regexp
+  nil t))
  (let* ((filename (concat (match-string 1) ".aux")))
(setq found (tex-numbers-label-to-number-helper label 
filename
(when found
@@ -209,10 +195,12 @@ There should be a corresponding function 
`tex-numbers-MACRO-display'
 that returns a fold display string for that macro."
   :type '(repeat string))
 
-(defun tex-numbers--capf-install ()
-  "Install `completion-at-point' function for label numbers."
-  (add-hook 'completion-at-point-functions #'tex-numbers-completion-at-point 
nil t)
-  (remove-hook 'completion-at-point-functions #'TeX--completion-at-point t))
+(defun tex-numbers-label-annotation-advice (orig-fun label)
+  "Return context for LABEL, augmented by the corresponding label number."
+  (concat
+   (funcall orig-fun label)
+   (when-let ((number (tex-numbers-label-to-number label)))
+ (format " (%s)" number
 
 ;;;###autoload
 (define-minor-mode tex-numbers-mode
@@ -222,7 +210,8 @@ that returns a fold display string for that macro."
   (cond
(tex-numbers-mode
 (setq preview-preprocess-function #'tex-numbers-preview-preproce

[elpa] externals/auctex-cont-latexmk 2893258541 010/100: docs

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 2893258541723b1306f732b408e3450dbfde505f
Author: Paul Nelson 
Commit: Paul Nelson 

docs
---
 README.org | 23 +++
 czm-tex-compile.el |  4 ++--
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/README.org b/README.org
new file mode 100644
index 00..f43bd2fce5
--- /dev/null
+++ b/README.org
@@ -0,0 +1,23 @@
+#+title: czm-preview.el: Convenience functions for compiling LaTeX
+#+author: Paul Nelson
+
+* Overview
+This package provides convenience functions that support a LaTeX workflow 
where =latexmk= continuously compiles the document in the background.
+
+* Configuration
+Download this repository, install using =M-x package-install-file= (or 
package-vc-install, straight, elpaca, ...), and add something like the 
following to your [[https://www.emacswiki.org/emacs/InitFile][init file]]:
+#+begin_src elisp
+(use-package czm-tex-compile
+:bind
+("C-c k" . czm-tex-compile)
+("s-]" . czm-tex-compile-next-error)
+("s-[" . czm-tex-compile-previous-error))
+#+end_src
+Replace the keybindings with whatever you prefer (or delete them and just run 
the commands via =M-x=).
+
+* Usage
+
+- If you run =czm-tex-compile= in a TeX buffer visiting "foo.tex", it starts 
an =eshell= buffer =*eshell-foo*= in the background that continuously compiles 
the current document.  Use =M-x customize-variable czm-tex-compile-command= to 
customize the compilation command.  If you run the same command again, then it 
switches to the =eshell= buffer.
+- =czm-tex-compile-next-error= and =czm-tex-compile-previous-error= navigate 
the error and warning messages encountered in the log file produced by 
=latexmk=, jumping to the corresponding positions in the tex buffer.
+
+That's all.  I prefer this workflow to the alternative in which one compiles 
the document manually via =TeX-command-master= (=C-c C-c=) and navigates the 
warning/error messages using =next-error= (=M-n=) and =previous-error (=M-p=).  
It also gives a handy way to keep the .aux files up-to-date; I take advantage 
of this feature in the packages 
[[https://github.com/ultronozm/czm-preview.el][czm-preview.el]] and 
[[https://github.com/ultronozm/czm-tex-fold.el][czm-tex-fold.el]] to annotate 
th [...]
diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 3d20563403..6f7786c60c 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -1,11 +1,11 @@
-;;; czm-tex-compile.el --- Convenience functions compiling LaTeX  -*- 
lexical-binding: t; -*-
+;;; czm-tex-compile.el --- Convenience functions for compiling LaTeX  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2023  Paul D. Nelson
 
 ;; Author: Paul D. Nelson 
 ;; Version: 0.0
 ;; URL: https://github.com/ultronozm/czm-tex-compile.el
-;; Package-Requires: ((emacs "29.1") (auctex "11.86.1"))
+;; Package-Requires: ((emacs "29.1"))
 ;; Keywords: tex
 
 ;; This program is free software; you can redistribute it and/or modify



[elpa] externals/auctex-cont-latexmk a541f4e4a6 025/100: prototype implementation of core flymake functionality

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit a541f4e4a697254267622e9636461f07636aa243
Author: Paul Nelson 
Commit: Paul Nelson 

prototype implementation of core flymake functionality

Now just need to get a timer running that checks when the log file
updates.

Maybe also think of a way to declare certain diagnostics "stale" when
there's been editing around them?  Not sure.
---
 czm-tex-compile.el | 101 +
 1 file changed, 101 insertions(+)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 12c0233682..8dd9a87a57 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -188,6 +188,107 @@ DIRECTION should be either \='next or \='previous."
(format "%s" (cdr czm-tex-compile--log-state)))
 
 
+(defun czm-tex-compile-process-log ()
+  (let* ((tex-file (buffer-file-name))
+(log-file (concat (file-name-sans-extension tex-file)
+   ".log"))
+results)
+(with-temp-buffer
+  (insert-file-contents log-file)
+  (goto-char (point-min))
+  (while (re-search-forward (concat "^" (regexp-opt '("! " "LaTeX Warning: 
"))
+"[^ ]")
+nil t)
+(save-excursion
+ (goto-char (match-beginning 0))
+ (let* ((error-p (looking-at "! "))
+ (description (if error-p (buffer-substring-no-properties 
(point)
+  
(line-end-position))
+(czm-tex-compile--paragraph-as-line)))
+ line prefix)
+   (if error-p
+   (progn
+ (save-excursion
+(when
+   (re-search-forward "^l\\.\\([0-9]+\\) " nil t)
+  (setq line (when (match-string 1)
+   (string-to-number (match-string 1
+ (setq prefix (buffer-substring-no-properties (point)
+   
(line-end-position))
+ (when (string-match "input line \\([0-9]+\\)" description)
+   (setq line (string-to-number (match-string 1 description)
+(when line
+  (push (list error-p description line prefix)
+results))
+(setq results
+  (mapcar
+   (lambda (result)
+ (cl-destructuring-bind (error-p description line prefix)
+ result
+   (list error-p
+ description
+ (if prefix
+ (let ((pos
+(save-excursion
+  (save-restriction
+(widen)
+(goto-char (point-min))
+(forward-line (1- line))
+;; should probably just delete any
+;; "..." at beginning
+(let ((truncated-prefix
+   (substring prefix
+  (max 0 (- (length prefix)
+3)
+  (search-forward truncated-prefix nil 
t))
+   (when pos
+ (cons pos (1+ pos
+   (flymake-diag-region (current-buffer)
+line)
+   results))
+results))
+
+(defun czm-tex-compile--fresh-p ()
+  "Return non-nil if logged errors should apply to current buffer.
+This is the case if the current buffer is not modified, the
+current buffer is a file, the current buffer has a log file, and
+the log file is newer than the current buffer."
+  (when-let* ((file (buffer-file-name))
+  (log-file (concat (file-name-sans-extension file)
+".log")))
+(and
+ (not (buffer-modified-p))
+ (file-exists-p file)
+ (file-exists-p log-file)
+ (time-less-p (nth 5 (file-attributes file))
+  (nth 5 (file-attributes log-file))
+
+(defun czm-tex-compile-flymake (report-fn &rest args)
+  "Flymake backend for LaTeX based on latexmk.
+REPORT-FN is the function called to report diagnostics.
+ARGS are the keyword-value pairs concerning edits"
+  (message "diagnostics time! %s" args)
+  (when (czm-tex-compile--fresh-p)
+(let* ((log-data (czm-tex-compile-process-log))
+   (diags (mapcar
+   (lambda (datum)
+ (cl-destructuring-bind (error-p description region)
+ datum
+   (flymake-make-diagnostic
+(current-buffer)
+(car regi

[elpa] externals/auctex-cont-latexmk a9d825f79c 069/100: attempt to make compilation command OS-compatible

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit a9d825f79c60c2c354dbd57ed7949420d56f9068
Author: Paul Nelson 
Commit: Paul Nelson 

attempt to make compilation command OS-compatible
---
 tex-continuous.el | 56 +--
 1 file changed, 30 insertions(+), 26 deletions(-)

diff --git a/tex-continuous.el b/tex-continuous.el
index 8d558618cc..60582054b9 100644
--- a/tex-continuous.el
+++ b/tex-continuous.el
@@ -50,24 +50,37 @@
   :type 'boolean)
 
 (defcustom tex-continuous-command
-  "latexmk -pvc -shell-escape -pdf -view=none -e '$pdflatex=q/pdflatex %O 
-synctex=1 -interaction=nonstopmode %S/'"
+  '("latexmk -pvc -shell-escape -pdf -view=none -e "
+("$pdflatex=q/pdflatex %O -synctex=1 -interaction=nonstopmode %S/"))
   "Command to compile LaTeX documents.
-This is combined with an additional option to output build files to a
-directory, if `TeX-output-dir' is set, and the name of the master file."
-  :type 'string)
-
-(defun tex-continuous--build-file (ext)
-  "Return the build file with extension EXT.
-Takes into account `TeX-output-dir'."
-  (if TeX-output-dir
-  (let ((master-dir (TeX-master-directory)))
-(concat (or (TeX--master-output-dir master-dir t)
-master-dir)
-(file-name-nondirectory (TeX-master-file ext
-(TeX-master-file ext)))
-
-(defun tex-continuous-process-item (type file line message offset _context 
search-string
- _line-end bad-box _error-point ignore)
+This is a list consisting of strings or lists of strings.  It is
+compiled to a single string by concatenating the strings and quoting the
+lists, using system-specific quotes.  To produce the compilation
+command, it is combined with an additional option to output build files
+to a directory (if `TeX-output-dir' is set) and the name of the master
+file."
+  :type '(repeat (choice string (repeat string
+
+(defun tex-continuous--compilation-command ()
+  "Return the command used to compile the current LaTeX document."
+  (let ((quote
+ (if (memq system-type '(ms-dos windows-nt))
+ "\""
+   "'")))
+(concat
+ (mapconcat (lambda (item)
+  (if (listp item)
+  (concat quote (mapconcat #'identity item) quote)
+item))
+tex-continuous-command)
+ (when TeX-output-dir
+   (concat " -outdir=" (shell-quote-argument TeX-output-dir)))
+ " "
+ (shell-quote-argument (TeX-master-file "tex")
+
+(defun tex-continuous-process-item (type file line message offset _context
+ search-string _line-end bad-box
+ _error-point ignore)
   "Process an error or warning for the current TeX document.
 The arguments are as in `TeX-error-list'.  Return either nil or a
 triple (ERROR-P DESCRIPTION (BEG . END)), where ERROR-P is non-nil if it
@@ -229,15 +242,6 @@ report diagnostics."
 (delete-process process))
   (kill-buffer comp-buf))
 
-(defun tex-continuous--compilation-command ()
-  "Return the command used to compile the current LaTeX document."
-  (concat
-   tex-continuous-command
-   (when TeX-output-dir
- (format " -outdir='%s'" TeX-output-dir))
-   " "
-   (TeX-master-file "tex")))
-
 ;;;###autoload
 (define-minor-mode tex-continuous-mode
   "If enabled, run LaTeX compilation on the current buffer."



[elpa] externals/auctex-cont-latexmk e32ff4bc0f 001/100: Initial commit

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit e32ff4bc0f267badd30d7aa23831541f1dc48ccc
Author: Paul Nelson <63298781+ultron...@users.noreply.github.com>
Commit: GitHub 

Initial commit
---
 .gitignore | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00..206569dc66
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,11 @@
+# Compiled
+*.elc
+
+# Packaging
+.cask
+
+# Backup files
+*~
+
+# Undo-tree save-files
+*.~undo-tree



[elpa] externals/auctex-cont-latexmk a3af9c0f47 044/100: refactoring to make functions smaller

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit a3af9c0f47377c94a8f53d285f96e2ec20e061b8
Author: Paul Nelson 
Commit: Paul Nelson 

refactoring to make functions smaller
---
 czm-tex-compile.el | 160 +++--
 1 file changed, 93 insertions(+), 67 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 321fec8d41..8f05574685 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -146,6 +146,92 @@ Also kill the timer for watching the log file."
   :type 'boolean
   :group 'czm-tex)
 
+
+(defun czm-tex-compile--parse-log-buffer (log-file)
+  "Retrieve parsed TeX error list from LOG-FILE."
+  (with-temp-buffer
+(insert-file-contents log-file)
+(goto-char (point-min))
+(while (re-search-forward "Warning:" nil t)
+  (end-of-line)
+  (while (not (looking-at "\n\n"))
+(delete-char 1)
+(end-of-line)))
+(TeX-parse-all-errors)
+TeX-error-list))
+
+(defun czm-tex-compile--process-multiply-defined-warning (message buf)
+  "Get position of multiply defined MESSAGE labels in BUF."
+  (let ((label (progn
+ (string-match "`\\(.*\\)'" message)
+ (match-string 1 message
+(with-current-buffer buf
+  (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
+
+(defun czm-tex-compile--process-regular-error (context line current-buf)
+  "Get position of error and handle CONTEXT and LINE in CURRENT-BUF.
+Return a cons cell (BEG . END) indicating where the error happens, or
+nil if the error is not found."
+  (let ((prefix nil))
+(with-temp-buffer
+  (insert context)
+  (goto-char (point-min))
+  (when (re-search-forward "\nl\\.\\([0-9]+\\) " nil t)
+(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)
+ (search-forward truncated-prefix nil t)))
+(when pos
+  (cons pos (1+ pos)))
+
+(defun czm-tex-compile--process-and-filter-errors (items tex-file current-buf)
+  "Create detailed error list ITEMS in TEX-FILE and CURRENT-BUF.
+Output is a list of triples (ERROR-P DESCRIPTION REGION), as in the
+return value of `czm-tex-compile-process-log'."
+  (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 (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)))
+   items))
+
 (defun czm-tex-compile-process-log ()
   "Process log file for current LaTeX document.
 Returns a list of triples (ERROR-P DESCRIPTION REGION), where
@@ -154,72 +240,11 @@ 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")))
-(with-temp-buffer
-  (insert-file-contents log-file)
-  (goto-char (point-min))
-  (while (re-search-forward "Warning:" nil t)
-(end-of-line)
-(while (not (looking-at "\n\n"))
-  (delete-char 1)
-  (end-of-line)))
-  (TeX-parse-all-errors)
-  (mapcar
-   (lamb

[elpa] externals/auctex-cont-latexmk 832496d454 088/100: Support indirect buffers

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 832496d45422b731d56479168144272590150389
Author: Paul Nelson 
Commit: Paul Nelson 

Support indirect buffers

* tex-continuous.el (tex-continuous--buffer-file-name): New function.
(tex-continuous-process-item, tex-continuous--fresh-p): Use it.
---
 tex-continuous.el | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tex-continuous.el b/tex-continuous.el
index 9745ff3d43..1cdbedb6b9 100644
--- a/tex-continuous.el
+++ b/tex-continuous.el
@@ -108,6 +108,9 @@ Takes into account `TeX-output-dir'."
   (interactive)
   (message "%s" (tex-continuous--get-help (help-at-pt-kbd-string
 
+(defun tex-continuous--buffer-file-name ()
+  (or buffer-file-name (buffer-file-name (buffer-base-buffer
+
 (defun tex-continuous-process-item (type file line message offset _context
  search-string _line-end bad-box
  _error-point ignore)
@@ -125,7 +128,7 @@ is an error rather than a warning."
   (save-restriction
 (widen)
 (cond
- ((file-equal-p file (buffer-file-name))
+ ((file-equal-p file (tex-continuous--buffer-file-name))
   (when line
 (if (eq type 'error)
 (save-excursion
@@ -219,7 +222,7 @@ This is the case if the current buffer is not modified, the 
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
 either in a watching state or has not updated recently."
-  (when-let* ((file (buffer-file-name))
+  (when-let* ((file (tex-continuous--buffer-file-name))
   (log-file (tex-continuous--build-file "log")))
 (and
  (when-let ((buf tex-continuous--compilation-buffer))



[elpa] externals/auctex-cont-latexmk fb414265c0 009/100: Add czm-tex-compile--kill-buffer-hook

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit fb414265c0c2b12f308983cd0782429527213289
Author: Paul Nelson 
Commit: Paul Nelson 

Add czm-tex-compile--kill-buffer-hook
---
 czm-tex-compile.el | 12 
 1 file changed, 12 insertions(+)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index b13a2bacd5..3d20563403 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -50,6 +50,17 @@
   :type 'string
   :group 'czm-tex-compile)
 
+(defun czm-tex-compile--kill-buffer-hook ()
+  "Hook to kill the eshell buffer when the LaTeX buffer is killed."
+  (when (string-match "\\([^\.]+\\)\.tex" (buffer-name))
+(let* ((name (match-string 1 (buffer-name)))
+   (bufname (concat "*eshell-" name "*")))
+  (when (get-buffer bufname)
+(let ((kill-buffer-query-functions '()))
+  (with-current-buffer bufname
+(eshell-interrupt-process))
+  (kill-buffer bufname))
+
 ;;;###autoload
 (defun czm-tex-compile ()
   "Compile the current LaTeX document in an eshell buffer.
@@ -64,6 +75,7 @@ name of the current LaTeX file."
   (if (get-buffer bufname)
  (switch-to-buffer bufname)
(save-window-excursion
+  (add-hook 'kill-buffer-hook #'czm-tex-compile--kill-buffer-hook)
  (eshell "new")
  (rename-buffer bufname)
  (insert (concat czm-tex-compile-command " " name ".tex"))



[elpa] externals/auctex-cont-latexmk 5d724b7b9d 007/100: cleanup, docs

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 5d724b7b9db195ded3c4f7e4c2560eccd05b7edf
Author: Paul Nelson 
Commit: Paul Nelson 

cleanup, docs
---
 czm-tex-compile.el | 149 -
 1 file changed, 67 insertions(+), 82 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 84e3bd7934..98b0ec0486 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -23,77 +23,58 @@
 
 ;;; Commentary:
 
-;; Convenience functions for compiling LaTeX.  Under construction.
+;; This package provides convenience functions for compiling a LaTeX
+;; document continuously via latexmk and navigating the errors and
+;; warnings recorded in the log file.  Customize the variable
+;; `czm-tex-compile-command' to change the command used to compile the
+;; document.
+;;
+;; Sample use-package declaration:
+;;
+;; (use-package czm-tex-compile
+;; :vc (:url "https://github.com/ultronozm/czm-tex-compile.el.git";
+;;   :rev :newest)
+;; :after latex
+;; :bind
+;; ("C-c k" . czm-tex-compile)
+;; ("M-]" . czm-tex-compile-next-error)
+;; ("M-[" . czm-tex-compile-previous-error))
 
 ;;; Code:
 
 (require 'esh-mode)
 
-;;;###autoload
-(defun czm-tex-compile-start-latexmk-eshell ()
-  (interactive)
-  (if (string-match "\\([^\.]+\\)\.tex" (buffer-name))
-  (let ((name (match-string 1 (buffer-name
-   (let ((bufname (concat "*eshell-" name "*")))
- (if (get-buffer bufname)
- (switch-to-buffer bufname)
-   (save-window-excursion
- (eshell "new")
- (rename-buffer bufname)
- (insert (concat "latexmk -shell-escape -pvc -pdf -view=none " 
name ".tex"))
- (eshell-send-input)))
-
-;; next three are experimental
-
-(defun czm-tex-compile-my-latexmk-this-0 ()
-  (interactive)
-  (if (string-match "\\([^\.]+\\)\.tex" (buffer-name))
-  (let ((name (match-string 1 (buffer-name)))
-(default-directory (file-name-directory (buffer-file-name
-(let ((bufname (concat "*latexmk-" name "*")))
-  (with-current-buffer (get-buffer-create bufname)
-(compilation-start (format "latexmk -shell-escape -pvc -pdf 
-view=none %s.tex" name) 'compilation-mode)
-(display-buffer bufname))
-
-(defun czm-tex-compile-my-latexmk-this ()
-  (interactive)
-  (if (string-match "\\([^\.]+\\)\.tex" (buffer-name))
-  (let ((name (match-string 1 (buffer-name)))
-(default-directory (file-name-directory (buffer-file-name
-(let ((bufname (concat "*latexmk-" name "*")))
-  (with-current-buffer (get-buffer-create bufname)
-(unless (eq major-mode 'compilation-mode)
-  (compilation-mode))
-(compilation-start (format "latexmk -shell-escape -pvc -pdf 
-view=none %s.tex" name) nil
-   (lambda (_mode-name) bufname))
-(display-buffer bufname)
-(local-set-key (kbd "x") 'czm-tex-compile-my-kill-compilation))
-
-(defun czm-tex-compile-my-kill-compilation ()
-  "Kill the current compilation process."
-  (interactive)
-  (when (get-buffer-process (current-buffer))
-(interrupt-process (get-buffer-process (current-buffer)))
-(message "Compilation process killed.")))
-
-;; Maybe improve this at some point using the following:
-;; (let ((entry (save-excursion
-;;  (bibtex-beginning-of-entry)
-;;  (bibtex-parse-entry
-;;   (cdr (assoc "=key=" entry))
+(defcustom czm-tex-compile-command
+  "latexmk -shell-escape -pvc -pdf -view=none -e '$pdflatex=q/pdflatex %O 
-interaction=nonstopmode %S/'"
+  "Command to compile LaTeX documents."
+  :type 'string
+  :group 'czm-tex-compile)
 
-(defun czm-tex-compile-my-paragraph-as-line ()
+;;;###autoload
+(defun czm-tex-compile ()
+  "Compile the current LaTeX document in an eshell buffer.
+If the eshell buffer already exists, switch to it.  Otherwise,
+create a new eshell buffer and compile the document in it.  The
+eshell buffer is named *eshell-*, where .tex is the
+name of the current LaTeX file."
   (interactive)
-  (let ((beg (point))
-   (end (save-excursion
-  (forward-paragraph)
-  (point
-(replace-regexp-in-string "\n" "" (buffer-substring-no-properties beg 
end
-
-(defvar-local czm-tex-compile-log-state nil
+  (when (string-match "\\([^\.]+\\)\.tex" (buffer-name))
+(let* ((name (match-string 1 (buffer-name)))
+   (bufname (concat "*eshell-" name "*")))
+  (if (get-buffer bufname)
+ (switch-to-buffer bufname)
+   (save-window-excursion
+ (eshell "new")
+ (rename-buffer bufname)
+ (insert (concat czm-tex-compile-command " " name ".tex"))
+ (eshell-send-input))
+
+(defvar-local czm-tex-compile--log-state nil
   "Cons containing last navigation time and log file position.")
 
 (defun czm-tex-compile--paragraph-as-line ()
+  "Return the current pa

[elpa] externals/auctex-label-numbers 78abc0d797 09/12: swap cl for seq

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-label-numbers
commit 78abc0d797aeba07e3258471d010f11974986529
Author: Paul Nelson 
Commit: Paul Nelson 

swap cl for seq
---
 tex-numbers.el | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tex-numbers.el b/tex-numbers.el
index 996f965e68..81b99d9418 100644
--- a/tex-numbers.el
+++ b/tex-numbers.el
@@ -227,7 +227,8 @@ Call ORIG-FUN with ARGS, and add the label number to the 
annotation."
   (when (and (member macro (cadr spec))
  (not (eq (car spec) func)))
 (push (cons macro (car spec)) tex-numbers--saved-spec-list)
-(setcdr spec (list (cl-remove macro (cadr spec) :test 'equal)
+(setcdr spec (list
+  (seq-remove (lambda (x) (equal x macro)) (cadr 
spec))
 (add-to-list 'TeX-fold-macro-spec-list (list func (list macro)
 (when TeX-fold-mode
   (TeX-fold-mode 1)))
@@ -240,8 +241,8 @@ Call ORIG-FUN with ARGS, and add the label number to the 
annotation."
 (dolist (macro tex-numbers-macro-list)
   (let ((func (intern (format "tex-numbers-%s-display" macro
 (setq TeX-fold-macro-spec-list
-  (cl-remove-if (lambda (elem) (eq (car elem) func))
-TeX-fold-macro-spec-list)))
+  (seq-remove (lambda (elem) (eq (car elem) func))
+  TeX-fold-macro-spec-list)))
   (when-let ((saved (assoc macro tex-numbers--saved-spec-list)))
 (dolist (spec TeX-fold-macro-spec-list)
   (when (eq (car spec) (cdr saved))



[elpa] externals/auctex-label-numbers 71e97e97b7 08/12: clean up, bump version, add readme details

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-label-numbers
commit 71e97e97b7cefbd3763a06237ee3e480ff292ac0
Author: Paul Nelson 
Commit: Paul Nelson 

clean up, bump version, add readme details
---
 README.org |  40 +
 tex-numbers.el | 133 +++--
 2 files changed, 112 insertions(+), 61 deletions(-)

diff --git a/README.org b/README.org
new file mode 100644
index 00..fb26c94ebd
--- /dev/null
+++ b/README.org
@@ -0,0 +1,40 @@
+#+title: tex-numbers.el: Numbering for LaTeX previews and folds
+#+author: Paul D. Nelson
+
+* Overview
+The package provides a function, =tex-numbers-label-to-number=, that retrieves 
label numbers in LaTeX documents.  This function is used to implement a global 
minor mode, =tex-numbers-mode=, that augments the preview and folding features 
of 
[[https://www.gnu.org/software/auctex/manual/auctex/Installation.html#Installation][AUCTeX]]:
+
+- Previews of labeled equations are numbered as in the compiled
+  document.
+
+- The macros =\ref=, =\eqref=, and =\label= are folded with the
+  corresponding numbers.
+
+- =completion-at-point= annotations for the contents of =\ref= and
+  =\eqref= include equation numbers.
+
+- Annotations for the command =reftex-goto-label=.
+
+* Configuration
+This package requires 
[[https://www.gnu.org/software/auctex/manual/auctex/Installation.html#Installation][AUCTeX]],
 so install that first.
+
+Download this repository, install using =M-x package-install-file= (or 
package-vc-install, straight, elpaca, ...), and add something like the 
following to your [[https://www.emacswiki.org/emacs/InitFile][init file]]:
+#+begin_src elisp
+  (use-package tex-numbers
+:after latex
+:config
+(tex-numbers-mode 1))
+#+end_src
+With this, the package activates automatically.
+
+You could alternatively use simply =(use-package tex-numbers)= and activate 
via =M-x tex-numbers-mode= or =(tex-numbers-mode 1)= whenever you'd like (e.g., 
in the middle of some other customizations of =TeX-fold-mode=).  If you'd like 
to enable some (but not all) of the provided functionality, then you can 
extract from the definition of =tex-numbers-mode= the pieces that you'd like 
and put those in your config.
+
+* Usage
+The label numbers are retrieved from the aux file of the compiled document.  
To update them, one should compile the document, regenerate the previews and 
refresh the folds.
+
+The previews should be numbered automated.  To activate the folds, you'll want 
to make sure =TeX-fold-mode= is enabled (=C-c C-o C-f= to toggle) and then fold 
the buffer (=C-c C-o C-b=) -- see the 
[[https://www.gnu.org/software/auctex/manual/auctex/Folding.html ][folding 
section]] of AUCTeX's manual for details.
+
+I use the packages 
[[https://github.com/ultronozm/tex-continuous.el][tex-continuous.el]] and 
[[https://github.com/ultronozm/preview-auto.el][preview-auto.el]] (with the 
variable =preview-auto-refresh-after-compilation= is set to its default value, 
=t=) to compile the document and regenerate the previews automatically, and 
refresh the folds as needed using =TeX-fold-section= (=C-c C-o C-s=).
+
+* Customization
+By customizing the variable =tex-numbers-label-to-number-function=, one could 
specify a different way to retrieve label numbers, e.g., by querying an LSP 
server.
diff --git a/tex-numbers.el b/tex-numbers.el
index 2149ab07f0..996f965e68 100644
--- a/tex-numbers.el
+++ b/tex-numbers.el
@@ -1,9 +1,9 @@
-;;; tex-numbers.el --- numbering for LaTeX previews and folds  -*- 
lexical-binding: t; -*-
+;;; tex-numbers.el --- Numbering for LaTeX previews and folds  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2024  Paul D. Nelson
 
 ;; Author: Paul D. Nelson 
-;; Version: 0.0
+;; Version: 0.1
 ;; URL: https://github.com/ultronozm/tex-numbers.el
 ;; Package-Requires: ((emacs "27.1") (auctex "14.0.5"))
 ;; Keywords: tex
@@ -23,38 +23,11 @@
 
 ;;; Commentary:
 
-;; This package augments the preview and folding features of AUCTeX:
-;;
-;; - Previews of labeled equations are numbered as in the compiled
-;;   document.
-;;
-;; - The the macros \\ref, \\eqref, and \\label are folded with the
-;;   corresponding numbers.
-;;
-;; - completion-at-point annotations for the contents of \\ref and
-;;   \\eqref include equation numbers.
-;;
-;; TEMPORARY NOTE: this package currently only works with the master
-;; branch of AUCTeX.  Its release is intended to be synchronized with
-;; the next release of AUCTeX.
-;;
-;; Activate via M-x tex-numbers-mode, or by adding to your init file:
-;;
-;; (use-package tex-numbers
-;;   :hook
-;;   (LaTeX-mode . tex-numbers-mode))
-;;
-;; The package provides an interface for retrieving label numbers in
-;; LaTeX documents.  This interface is used to implement a global
-;; minor mode, `tex-numbers-mode', which enables the noted features.
-;;
-;; The label numbers are retrieved from the aux file of the compiled
-;; document.  To update them, one should compile the document,
-;; regen

[elpa] externals/auctex-cont-latexmk 6a9518e566 097/100: indentation, swap cl for seq

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 6a9518e5668c49b929dfb817997d5b8419d4ede1
Author: Paul Nelson 
Commit: Paul Nelson 

indentation, swap cl for seq
---
 auctex-cont-latexmk.el | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/auctex-cont-latexmk.el b/auctex-cont-latexmk.el
index 06fe1e1373..ee633e14e6 100644
--- a/auctex-cont-latexmk.el
+++ b/auctex-cont-latexmk.el
@@ -139,7 +139,8 @@ Adapted from `TeX-format-filter'"
(not (memq (char-after (1+ (point))) '(?\n ?\()))
(not (and (eq (char-before) ?.)
  (char-after (1+ (point)))
- (not (eq ?w (char-syntax (char-after (1+ 
(point)
+ (not (eq ?w (char-syntax
+  (char-after (1+ (point)
   (delete-char 1
 
 (defun tex-continuous--error-list (log-file)
@@ -295,7 +296,8 @@ empty, except when NOKILL is non-nil."
 (when (and comp-buf (buffer-live-p comp-buf))
   (with-current-buffer comp-buf
 (setq tex-continuous--subscribed-buffers
-  (cl-remove buf tex-continuous--subscribed-buffers))
+  (seq-remove (lambda (b) (eq b buf))
+  tex-continuous--subscribed-buffers))
 (when (null tex-continuous--subscribed-buffers)
   (setq done t)))
   (when done
@@ -349,7 +351,8 @@ This is called from the compilation buffer when it is 
killed."
(get-buffer comp-buf-name))
   (special-mode)
   (add-hook 'after-change-functions #'tex-continuous--update-time nil 
t)
-  (add-hook 'kill-buffer-hook #'tex-continuous--cancel-subscriptions 
nil t)
+  (add-hook 'kill-buffer-hook
+#'tex-continuous--cancel-subscriptions nil t)
   (push buf tex-continuous--subscribed-buffers
 (add-hook 'kill-buffer-hook 'tex-continuous--unsubscribe nil t)
 (setq tex-continuous--disable-function 'tex-continuous-mode-disable)



[elpa] externals/auctex-cont-latexmk 2a48f822c9 084/100: Deactivate when the compilation buffer is killed

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 2a48f822c9ce9a9d392a13242397ca2108b23d6e
Author: Paul Nelson 
Commit: Paul Nelson 

Deactivate when the compilation buffer is killed
---
 tex-continuous.el | 36 
 1 file changed, 28 insertions(+), 8 deletions(-)

diff --git a/tex-continuous.el b/tex-continuous.el
index fc809324ce..783b2be226 100644
--- a/tex-continuous.el
+++ b/tex-continuous.el
@@ -254,8 +254,10 @@ report diagnostics."
 (defvar-local tex-continuous--subscribed-buffers nil
   "List of buffers subscribed to the current LaTeX compilation.")
 
-(defun tex-continuous--unsubscribe ()
-  "Unsubscribe from LaTeX compilation if the current buffer is in the list."
+(defun tex-continuous--unsubscribe (&optional nokill)
+  "Unsubscribe from LaTeX compilation if the current buffer is in the list.
+This kills the compilation buffer when its subscriber list becomes
+empty, except when NOKILL is non-nil."
   (let ((buf (current-buffer))
 (comp-buf tex-continuous--compilation-buffer)
 done)
@@ -271,7 +273,25 @@ report diagnostics."
 (interrupt-process process)
 (sit-for 0.1)
 (delete-process process))
-  (kill-buffer comp-buf))
+  (unless nokill
+(kill-buffer comp-buf)))
+
+(defvar-local tex-continuous--disable-function nil
+  "Function to disable `tex-continuous' features.
+This will be either `tex-continuous-mode-disable' or
+`tex-continuous-turn-off'.")
+
+(defun tex-continuous--disable ()
+  "Disable `tex-continuous' features."
+  (when tex-continuous--disable-function
+(funcall tex-continuous--disable-function)))
+
+(defun tex-continuous--cancel-subscriptions ()
+  "Cancel all subscriptions to LaTeX compilation.
+This is called from the compilation buffer when it is killed."
+  (dolist (buf tex-continuous--subscribed-buffers)
+(with-current-buffer buf
+  (tex-continuous--disable
 
 (defun tex-continuous-mode-disable ()
   "Disable `tex-continuous-mode' in all buffers."
@@ -298,9 +318,11 @@ report diagnostics."
(get-buffer comp-buf-name))
   (special-mode)
   (add-hook 'after-change-functions #'tex-continuous--update-time nil 
t)
+  (add-hook 'kill-buffer-hook #'tex-continuous--cancel-subscriptions 
nil t)
   (push buf tex-continuous--subscribed-buffers
 (add-hook 'kill-buffer-hook 'tex-continuous--unsubscribe nil t)
-(add-hook 'after-set-visited-file-name-hook 'tex-continuous-mode-disable 
nil t)
+(setq tex-continuous--disable-function 'tex-continuous-mode-disable)
+(add-hook 'after-set-visited-file-name-hook 'tex-continuous--disable nil t)
 (when tex-continuous--timer
   (cancel-timer tex-continuous--timer)
   (setq tex-continuous--timer nil))
@@ -309,7 +331,7 @@ report diagnostics."
(t
 (tex-continuous--unsubscribe)
 (remove-hook 'kill-buffer-hook 'tex-continuous--unsubscribe t)
-(remove-hook 'after-set-visited-file-name-hook 
'tex-continuous-mode-disable t)
+(remove-hook 'after-set-visited-file-name-hook 'tex-continuous--disable t)
 (when tex-continuous--report-fn
   (setq tex-continuous--report-fn nil)
 
@@ -326,8 +348,7 @@ Also set `flymake-diagnostic-functions' to 
`tex-continuous-flymake'."
 flymake-diagnostic-functions)
   (setq-local flymake-diagnostic-functions '(tex-continuous-flymake))
   (flymake-mode 1)
-  (remove-hook 'after-set-visited-file-name-hook 'tex-continuous-mode-disable 
t)
-  (add-hook 'after-set-visited-file-name-hook 'tex-continuous-turn-off nil t)
+  (setq tex-continuous--disable-function 'tex-continuous-turn-off)
   (message "tex-continuous-mode and flymake-mode enabled"))
 
 (defun tex-continuous-turn-off ()
@@ -338,7 +359,6 @@ Also restore `flymake-diagnostic-functions'."
   (flymake-mode 0)
   (setq-local flymake-diagnostic-functions
   tex-continuous--saved-flymake-diagnostic-functions)
-  (remove-hook 'after-set-visited-file-name-hook 'tex-continuous-turn-off t)
   (message "tex-continuous-mode and flymake-mode disabled"))
 
 ;;;###autoload



[elpa] externals/auctex-label-numbers f11407452f 04/12: incorporate feedback from Arash

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-label-numbers
commit f11407452f216a6f6eded4a945dbc2c17cfc052f
Author: Paul Nelson 
Commit: Paul Nelson 

incorporate feedback from Arash
---
 tex-numbers.el | 34 +++---
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/tex-numbers.el b/tex-numbers.el
index 119393c67b..7a26f3ccca 100644
--- a/tex-numbers.el
+++ b/tex-numbers.el
@@ -5,7 +5,7 @@
 ;; Author: Paul D. Nelson 
 ;; Version: 0.0
 ;; URL: https://github.com/ultronozm/tex-numbers.el
-;; Package-Requires: ((emacs "26.1") (auctex))
+;; Package-Requires: ((emacs "27.1") (auctex "14.0.5"))
 ;; Keywords: tex
 
 ;; This program is free software; you can redistribute it and/or modify
@@ -59,6 +59,7 @@
 (require 'latex)
 (require 'tex-fold)
 (require 'preview)
+(require 'reftex)
 
 (defgroup tex-numbers nil
   "Numbering for LaTeX previews and folds."
@@ -88,10 +89,9 @@ Return the updated cache, or nil if the aux file does not 
exist."
 cache
 
 (defun tex-numbers-label-to-number-helper (label aux-file)
-  "Get the number of LABEL from the aux file AUX-FILE.
-Check the cache first, and update it if the aux file has changed.
-Return the label number as a string, or nil if the label cannot be
-found."
+  "Get the number of LABEL from the AUX-FILE.
+Check the cache first, and update it if AUX-FILE has changed.  Return
+the label number as a string, or nil if the label cannot be found."
   (let ((cache (gethash aux-file tex-numbers-cache)))
 (if (or (not cache)
 (time-less-p (gethash 'timestamp cache)
@@ -106,8 +106,10 @@ If non-nil, `tex-numbers-label-to-number' delegates to 
this function.
 The function should take a label string as its argument and return the
 corresponding label number as a string, or nil if that number cannot be
 retrieved."
-  :type '(choice (const :tag "Default" nil) function)
-  :group 'tex-numbers)
+  :type '(choice (const :tag "Default" nil) function))
+
+(defconst tex-numbers--external-document-regexp
+  "external\\(?:cite\\)?document\\(?:\\[[^]]+\\]\\)\\{0,2\\}{\\([^}]+\\)}")
 
 (defun tex-numbers-label-to-number (label)
   "Get number of LABEL for current tex buffer.
@@ -138,20 +140,23 @@ with \"X\"."
 (defun tex-numbers-preview-preprocessor (str)
   "Preprocess STR for preview by adding tags to labels.
 Uses `tex-numbers-label-to-number-function' to retrieve label numbers."
-  (let ((buf (current-buffer)))
+  (let ((buf (current-buffer))
+(label-re
+ (concat "\\(?:" (mapconcat #'identity reftex-label-regexps "\\|") 
"\\)")))
 (with-temp-buffer
   (insert str)
   (goto-char (point-min))
-  (while (re-search-forward "label{\\([^}]+\\)}" nil t)
+  (while (re-search-forward label-re nil t)
 (let ((label (match-string 1)))
   (when-let ((number
   (with-current-buffer buf
 (tex-numbers-label-to-number label
 (when (let ((comment-start-skip
- "\\(\\(^\\|[^\\
-]\\)\\(\\)*\\)\\(%+[   ]*\\)"))
-;; HACK: texmathp expects to be run in LaTeX-mode,
-;; but here we are in a temporary buffer.
+ (concat
+  "\\(\\(^\\|[^\\\n]\\)\\("
+  (regexp-quote TeX-esc)
+  (regexp-quote TeX-esc)
+  "\\)*\\)\\(%+ *\\)")))
 (texmathp))
   (insert (format "\\tag{%s}" number))
   (buffer-substring-no-properties (point-min) (point-max)
@@ -183,8 +188,7 @@ be retrieved."
 Each element describes a LaTeX macro that takes a label as its argument.
 There should be a corresponding function `tex-numbers-MACRO-display'
 that returns a fold display string for that macro."
-  :type '(repeat string)
-  :group 'tex-numbers)
+  :type '(repeat string))
 
 ;;;###autoload
 (define-minor-mode tex-numbers-mode



[elpa] externals/auctex-cont-latexmk 8333451e17 028/100: re-implement main logic using TeX-parse-all-errors

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 8333451e17eca4401926b77d476b859b66d7c271
Author: Paul Nelson 
Commit: Paul Nelson 

re-implement main logic using TeX-parse-all-errors

Now you just need to perfect the interface for disabling other flymake
backends, etc
---
 czm-tex-compile.el | 138 +++--
 1 file changed, 60 insertions(+), 78 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 0a10dfe1fa..7da21353f8 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -85,6 +85,7 @@ name of the current LaTeX file."
 (defvar-local czm-tex-compile--log-state nil
   "Cons containing last navigation time and log file position.")
 
+;; maybe delete this?
 (defun czm-tex-compile--paragraph-as-line ()
   "Return the current paragraph as a single line.
 Used for navigating LaTeX warnings in the log file."
@@ -95,29 +96,10 @@ Used for navigating LaTeX warnings in the log file."
  (point
 (replace-regexp-in-string "\n" "" (buffer-substring-no-properties beg 
end
 
-;; TODO: look for the line .bbl in the file, and don't jump to
-;; line numbers found in log entries beyond that point (just display
-;; them).
-
-(defun czm-tex-compile--log-parent ()
-  (beginning-of-line)
-  (let ((tally 0)
-(found nil))
-(while (and (null found) (> (point) (point-min)))
-  (forward-line -1)
-  (cond
-   ((looking-at "(")
-(cl-incf tally (count-matches "(" (line-beginning-position) 
(line-end-position)))
-(cl-decf tally (count-matches ")" (line-beginning-position) 
(line-end-position)))
-(when (equal 1 tally)
-  (setq found (buffer-substring-no-properties (1+ (point)) 
(line-end-position)
-   ((looking-at "[)]+")
-(cl-decf tally (length (match-string 0))
-found))
-
 (defun czm-tex-compile-process-log ()
   "Process the log file for the current LaTeX document."
-  (let* ((tex-file (buffer-file-name))
+  (let* ((current-buf (current-buffer))
+ (tex-file (buffer-file-name))
(log-file (concat (file-name-sans-extension tex-file)
".log"))
  (error-prefix "! ")
@@ -125,62 +107,58 @@ Used for navigating LaTeX warnings in the log file."
results)
 (with-temp-buffer
   (insert-file-contents log-file)
-  (goto-char (point-min))
-  (while (re-search-forward (concat "^" (regexp-opt (list error-prefix
-  warning-prefix))
-"[^ ]")
-nil t)
-(save-excursion
-(goto-char (match-beginning 0))
-(let* ((error-p (looking-at "! "))
- (description (if error-p (buffer-substring-no-properties (+ 
(length error-prefix)
- 
(point))
-  
(line-end-position))
-(substring
- (czm-tex-compile--paragraph-as-line)
- (length warning-prefix
- line prefix)
-  (if error-p
-  (progn
-   (save-excursion
-(when
- (re-search-forward "^l\\.\\([0-9]+\\) " 
nil t)
-  (setq line (when (match-string 1)
-   (string-to-number (match-string 1
-   (setq prefix 
(buffer-substring-no-properties (point)
-   
(line-end-position))
-(when (string-match "input line \\([0-9]+\\)" description)
-  (setq line (string-to-number (match-string 1 
description)
-(when line
-  (push (list error-p description line prefix)
-results))
-(setq results
-  (mapcar
-   (lambda (result)
- (cl-destructuring-bind (error-p description line prefix)
- result
-   (list error-p
- description
- (if prefix
- (let ((pos
-(save-excursion
-  (save-restriction
-(widen)
-(goto-char (point-min))
-(forward-line (1- line))
-;; should probably just delete any
-;; "..." at beginning?
-(let ((truncated-prefix
-   (substring prefix
-  (max 0 (- (length prefix)

[elpa] externals/auctex-cont-latexmk 78a651c254 093/100: add missing docstring

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 78a651c254d774168bea5e1f013c28f6da70630f
Author: Paul Nelson 
Commit: Paul Nelson 

add missing docstring
---
 tex-continuous.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tex-continuous.el b/tex-continuous.el
index 9cf37c0d7e..95fe4b8225 100644
--- a/tex-continuous.el
+++ b/tex-continuous.el
@@ -99,6 +99,7 @@ file."
   (message "%s" (tex-continuous--get-help (help-at-pt-kbd-string
 
 (defun tex-continuous--buffer-file-name ()
+  "Return the file name of the current buffer, or its base buffer."
   (or buffer-file-name (buffer-file-name (buffer-base-buffer
 
 (defun tex-continuous-process-item (type file line message offset _context



[elpa] externals/auctex-cont-latexmk d99ee12fe2 077/100: Allow updates when process buffer is empty

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit d99ee12fe250230332be580739ca25a8a9df70ef
Author: Paul Nelson 
Commit: Paul Nelson 

Allow updates when process buffer is empty

* tex-continuous.el (tex-continuous--fresh-p):
---
 tex-continuous.el | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tex-continuous.el b/tex-continuous.el
index 7bdb0ee6e8..6f1bfa2879 100644
--- a/tex-continuous.el
+++ b/tex-continuous.el
@@ -210,10 +210,11 @@ either in a watching state or has not updated recently."
 (forward-line -1)
 (equal (buffer-substring (point) (line-end-position))
tex-continuous--watching-str))
-  (and tex-continuous--last-update-time
-   (time-less-p (time-subtract (current-time)
-   tex-continuous--last-update-time)
-(seconds-to-time tex-continuous--wait-time))
+  (and (or
+tex-continuous--last-update-time
+(time-less-p (time-subtract (current-time)
+tex-continuous--last-update-time)
+ (seconds-to-time tex-continuous--wait-time)))
  (not (buffer-modified-p))
  (file-exists-p file)
  (file-exists-p log-file)



[elpa] branch externals/auctex-cont-latexmk created (now a769d92a2c)

2024-06-06 Thread ELPA Syncer
elpasync pushed a change to branch externals/auctex-cont-latexmk.

at  a769d92a2c rename: tex-continuous -> auctex-cont-latexmk

This branch includes the following new commits:

   new  e32ff4bc0f Initial commit
   new  27c1ef5c71 Add files via upload
   new  febe275533 Add autoloads
   new  4ff1de7926 fix most flycheck warnings
   new  962365441a Update czm-tex-compile.el
   new  09e362e9f6 fixed some silly bugs
   new  5d724b7b9d cleanup, docs
   new  3eeebb581f Fix "repeat when reversing direction" nuisance
   new  fb414265c0 Add czm-tex-compile--kill-buffer-hook
   new  2893258541 docs
   new  acfaf552b7 Add .html to .gitignore
   new  45bd7a6c32 switch back to previous reverse-direction style
   new  776337f0d8 Fix the direction issue
   new  6d8252a759 avoid unnecessary "find-file-noselect"
   new  c2d7e5cb90 delete resolved TODO from comments
   new  d052e767e6 Add synctex=1 to default compile command
   new  08d713ef4b improve handling of some failure cases
   new  447b9f3be2 add synctex to default options
   new  146dfe2350 Merge remote-tracking branch 'origin/main'
   new  8633c833d9 Update README.org
   new  dc130e1bfe Merge pull request #1 from 8vasu/patch-1
   new  dc493bf00c delete a couple lines that should have been deleted last 
time
   new  194e951633 Merge remote-tracking branch 'origin/main'
   new  b5bd4c5257 indentation
   new  a541f4e4a6 prototype implementation of core flymake functionality
   new  e20b97607e got it in OK shape, still quite rough tho
   new  6cd49a0317 about to hack stuff up
   new  8333451e17 re-implement main logic using TeX-parse-all-errors
   new  34c8588d7e fix some issues involving multiline warnings
   new  c3ff2df047 restrict errors to those associated to some file
   new  62c2eb652a print entire warning message (not every warning is a 
LaTeX warning)
   new  61cf12f244 for errors, just get line number directly
   new  ad6dc99345 fix flycheck warnings
   new  549d8c06a7 got it in decent working shape, modulo an occasional 
error
   new  c2069da6b9 reduce "sit-for" time
   new  5473521164 tweak readme
   new  2762ee8084 polish
   new  8b6924f833 fix typo and tweak README.org
   new  30694ac352 make TAB switch from compilation buffer back to tex file
   new  e5cce65c36 readme tweaks
   new  7c3c45f924 fix "tab goes from compilation buffer to tex buffer" 
feature
   new  9ffc065182 add support for flagging multiply-defined labels and bad 
boxes
   new  989be1a7a9 flycheck warnings
   new  a3af9c0f47 refactoring to make functions smaller
   new  ef4f329804 change description
   new  7e2cbfbc88 fix defcustom groups
   new  c1aa3aafe1 first attempt at fixing narrowing issues
   new  4320789184 remove unnecessary require
   new  1aee5cc114 add "ignored" user option, started rearranging
   new  1384905db7 rearrange
   new  de469de0a1 remove hbox from the list of ignored warnings
   new  ad40452870 check that line is non-nil
   new  7c7fcc15a9 mild factoring
   new  b082dacb78 some good clean-up
   new  8ed7904de5 maybe did ok
   new  d377100af3 cleaning up, hopefully not ruining everything
   new  2986f5ce44 got to working OK w/ multifile projects
   new  b3ec5c29d4 flycheck errors
   new  2639003039 tweaks
   new  973154d7d5 more tweaks
   new  c6d624934e some simplifications, clean-up
   new  fcb2ec2d87 tidy
   new  ae9171666e tidy
   new  c1a53a8e76 tidy
   new  f16d095aad rename, tweak
   new  79948cf651 tweaks, docs
   new  6cbd9d1493 respect TeX-output-dir
   new  993c2e62fe adapt TeX-format-filter to format log more robustly
   new  a9d825f79c attempt to make compilation command OS-compatible
   new  826cf967f4 clarify commentary
   new  43bdc08cf6 formatting
   new  70ce392004 clarify docstring
   new  d2f6dbaae4 correct use-package declaration
   new  a3ba987e68 add tex-continuous--build-file back in, at least for now
   new  91870fa1a2 add ":after latex" to the use-package declaration
   new  119577bfdf Allow latexmk completion to be detected based on timing
   new  d99ee12fe2 Allow updates when process buffer is empty
   new  6d80a69168 Clarify docstring
   new  d0fe19c0de Make tex-continuous-mode independent of flymake
   new  1ffdaaf722 Add some clarifications and remarks to the readme
   new  cdef4a9839 Remove t from flymake-diagnostic-functions
   new  831be210d9 Deactivate upon file rename
   new  b208286d55 Add some tips to README
   new  2a48f822c9 Deactivate when the compilation buffer is killed
   new  b73ac67b86 New command tex-continuous-help-at-point
   new  5e9df47daf Put errors without file or line number at end of buffer
   new  1c5248a3ac expand README tips
   new  832496d454 Support in

[elpa] externals/auctex-label-numbers 30919ac12f 11/12: rename to auctex-label-numbers.el

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-label-numbers
commit 30919ac12f2dec24692dd206b94ae0d7a2114ec5
Author: Paul Nelson 
Commit: Paul Nelson 

rename to auctex-label-numbers.el

https://lists.gnu.org/archive/html/emacs-devel/2024-05/msg01170.html
---
 README.org|  12 +--
 tex-numbers.el => auctex-label-numbers.el | 151 +++---
 2 files changed, 83 insertions(+), 80 deletions(-)

diff --git a/README.org b/README.org
index fb26c94ebd..ce60dd2a25 100644
--- a/README.org
+++ b/README.org
@@ -1,8 +1,8 @@
-#+title: tex-numbers.el: Numbering for LaTeX previews and folds
+#+title: auctex-label-numbers.el: Numbering for LaTeX previews and folds
 #+author: Paul D. Nelson
 
 * Overview
-The package provides a function, =tex-numbers-label-to-number=, that retrieves 
label numbers in LaTeX documents.  This function is used to implement a global 
minor mode, =tex-numbers-mode=, that augments the preview and folding features 
of 
[[https://www.gnu.org/software/auctex/manual/auctex/Installation.html#Installation][AUCTeX]]:
+The package provides a function, =auctex-label-numbers-label-to-number=, that 
retrieves label numbers in LaTeX documents.  This function is used to implement 
a global minor mode, =auctex-label-numbers-mode=, that augments the preview and 
folding features of 
[[https://www.gnu.org/software/auctex/manual/auctex/Installation.html#Installation][AUCTeX]]:
 
 - Previews of labeled equations are numbered as in the compiled
   document.
@@ -20,14 +20,14 @@ This package requires 
[[https://www.gnu.org/software/auctex/manual/auctex/Instal
 
 Download this repository, install using =M-x package-install-file= (or 
package-vc-install, straight, elpaca, ...), and add something like the 
following to your [[https://www.emacswiki.org/emacs/InitFile][init file]]:
 #+begin_src elisp
-  (use-package tex-numbers
+  (use-package auctex-label-numbers
 :after latex
 :config
-(tex-numbers-mode 1))
+(auctex-label-numbers-mode 1))
 #+end_src
 With this, the package activates automatically.
 
-You could alternatively use simply =(use-package tex-numbers)= and activate 
via =M-x tex-numbers-mode= or =(tex-numbers-mode 1)= whenever you'd like (e.g., 
in the middle of some other customizations of =TeX-fold-mode=).  If you'd like 
to enable some (but not all) of the provided functionality, then you can 
extract from the definition of =tex-numbers-mode= the pieces that you'd like 
and put those in your config.
+You could alternatively use simply =(use-package auctex-label-numbers)= and 
activate via =M-x auctex-label-numbers-mode= or =(auctex-label-numbers-mode 1)= 
whenever you'd like (e.g., in the middle of some other customizations of 
=TeX-fold-mode=).  If you'd like to enable some (but not all) of the provided 
functionality, then you can extract from the definition of 
=auctex-label-numbers-mode= the pieces that you'd like and put those in your 
config.
 
 * Usage
 The label numbers are retrieved from the aux file of the compiled document.  
To update them, one should compile the document, regenerate the previews and 
refresh the folds.
@@ -37,4 +37,4 @@ The previews should be numbered automated.  To activate the 
folds, you'll want t
 I use the packages 
[[https://github.com/ultronozm/tex-continuous.el][tex-continuous.el]] and 
[[https://github.com/ultronozm/preview-auto.el][preview-auto.el]] (with the 
variable =preview-auto-refresh-after-compilation= is set to its default value, 
=t=) to compile the document and regenerate the previews automatically, and 
refresh the folds as needed using =TeX-fold-section= (=C-c C-o C-s=).
 
 * Customization
-By customizing the variable =tex-numbers-label-to-number-function=, one could 
specify a different way to retrieve label numbers, e.g., by querying an LSP 
server.
+By customizing the variable =auctex-label-numbers-label-to-number-function=, 
one could specify a different way to retrieve label numbers, e.g., by querying 
an LSP server.
diff --git a/tex-numbers.el b/auctex-label-numbers.el
similarity index 58%
rename from tex-numbers.el
rename to auctex-label-numbers.el
index 8c6e7d51de..1b294ec832 100644
--- a/tex-numbers.el
+++ b/auctex-label-numbers.el
@@ -1,10 +1,10 @@
-;;; tex-numbers.el --- Numbering for LaTeX previews and folds  -*- 
lexical-binding: t; -*-
+;;; auctex-label-numbers.el --- Numbering for LaTeX previews and folds  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2024  Paul D. Nelson
 
 ;; Author: Paul D. Nelson 
 ;; Version: 0.1
-;; URL: https://github.com/ultronozm/tex-numbers.el
+;; URL: https://github.com/ultronozm/auctex-label-numbers.el
 ;; Package-Requires: ((emacs "27.1") (auctex "14.0.5"))
 ;; Keywords: tex
 
@@ -23,10 +23,11 @@
 
 ;;; Commentary:
 
-;; This package provides a function, `tex-numbers-label-to-number',
-;; that retrieves label numbers for LaTeX documents from the compiled
-;; aux file.  That function is used to implement a global minor mode,
-;; `tex-numbers-mode', that 

[elpa] externals/auctex-cont-latexmk 35cb9fac09 089/100: Check if compilation buffer has been killed before unsubscribing

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 35cb9fac09b7f9ff7ccf7b9379ef57fd5ef3b47c
Author: Paul Nelson 
Commit: Paul Nelson 

Check if compilation buffer has been killed before unsubscribing

* tex-continuous.el (tex-continuous--unsubscribe):
---
 tex-continuous.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tex-continuous.el b/tex-continuous.el
index 1cdbedb6b9..834daab224 100644
--- a/tex-continuous.el
+++ b/tex-continuous.el
@@ -285,7 +285,7 @@ empty, except when NOKILL is non-nil."
   (let ((buf (current-buffer))
 (comp-buf tex-continuous--compilation-buffer)
 done)
-(when comp-buf
+(when (and comp-buf (buffer-live-p comp-buf))
   (with-current-buffer comp-buf
 (setq tex-continuous--subscribed-buffers
   (cl-remove buf tex-continuous--subscribed-buffers))



[elpa] externals/auctex-cont-latexmk 91870fa1a2 075/100: add ":after latex" to the use-package declaration

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 91870fa1a24cc052a4c19397ed76f3b01fa89bb5
Author: Paul Nelson 
Commit: Paul Nelson 

add ":after latex" to the use-package declaration
---
 README.org | 1 +
 1 file changed, 1 insertion(+)

diff --git a/README.org b/README.org
index 731f0f0294..0c49a6b33e 100644
--- a/README.org
+++ b/README.org
@@ -8,6 +8,7 @@ This package provides a minor mode where 
[[https://ctan.org/pkg/latexmk?lang=en]
 Download this repository, install using =M-x package-install-file= (or 
package-vc-install, straight, elpaca, ...), and add something like the 
following to your [[https://www.emacswiki.org/emacs/InitFile][init file]]:
 #+begin_src elisp
 (use-package tex-continuous
+  :after latex
   :bind
   (:map LaTeX-mode-map
 ("C-c k" . tex-continuous-toggle)))



[elpa] externals/auctex-cont-latexmk 7c7fcc15a9 053/100: mild factoring

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 7c7fcc15a9ae455afeec2d2ead7990445ddf9b70
Author: Paul Nelson 
Commit: Paul Nelson 

mild factoring
---
 czm-tex-compile.el | 158 -
 1 file changed, 70 insertions(+), 88 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 8b96c25667..c1deee98f8 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -57,7 +57,7 @@
 (defvar-local czm-tex-compile--report-fn nil
   "Function provided by Flymake for reporting diagnostics.")
 
-(defvar-local czm-tex-compile--log-watch-timer nil
+(defvar-local czm-tex-compile--timer nil
   "Timer for reporting changes to the log file.")
 
 (defvar-local czm-tex-compile--compilation-buffer-name nil
@@ -72,9 +72,9 @@ Also kill the timer for watching the log file."
 (delete-process czm-tex-compile--process))
   (when (get-buffer czm-tex-compile--compilation-buffer-name)
 (kill-buffer czm-tex-compile--compilation-buffer-name))
-  (when czm-tex-compile--log-watch-timer
-(cancel-timer czm-tex-compile--log-watch-timer)
-(setq czm-tex-compile--log-watch-timer nil)))
+  (when czm-tex-compile--timer
+(cancel-timer czm-tex-compile--timer)
+(setq czm-tex-compile--timer nil)))
 
 (defconst czm-tex-compile--watching-str
   "=== Watching for updated files. Use ctrl/C to stop ..."
@@ -95,19 +95,6 @@ Also kill the timer for watching the log file."
   :type 'boolean
   :group 'czm-tex-compile)
 
-(defun czm-tex-compile--parse-log-buffer (log-file)
-  "Retrieve parsed TeX error list from LOG-FILE."
-  (with-temp-buffer
-(insert-file-contents log-file)
-(goto-char (point-min))
-(while (re-search-forward "Warning:" nil t)
-  (end-of-line)
-  (while (not (looking-at "\n\n"))
-(delete-char 1)
-(end-of-line)))
-(TeX-parse-all-errors)
-TeX-error-list))
-
 (defun czm-tex-compile--process-multiply-defined-warning (message buf)
   "Get position of multiply defined MESSAGE labels in BUF."
   (let ((label (progn
@@ -153,41 +140,16 @@ nil if the error is not found."
 (when pos
   (cons pos (1+ pos)))
 
-(defun czm-tex-compile--process-and-filter-errors (items tex-file current-buf)
-  "Create detailed error list ITEMS in TEX-FILE and CURRENT-BUF.
-Output is a list of triples (ERROR-P DESCRIPTION REGION), as in the
-return value of `czm-tex-compile-process-log'."
-  (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
-  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)))
-   items))
+(defun czm-tex-compile--error-list (log-file)
+  "Retrieve parsed TeX error list from LOG-FILE."
+  (with-temp-buffer
+(insert-file-contents log-file)
+(goto-char (point-min))
+(while (re-search-forward "Warning:" nil t)
+  (let ((fill-column most-positive-fixnum))
+(call-interactively 'fill-paragraph)))
+(TeX-parse-all-errors)
+TeX-error-list))
 
 (defun czm-tex-compile-process-log ()
   "Process log file for current LaTeX document.
@@ -197,10 +159,39 @@ 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"))
- (errors-list (czm-tex-compile--parse-log-buffer log-file)))
-(czm-tex-compile--process-and-filter-errors errors-list tex-file 
current-buf)))
+ (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))
+ (fil

[elpa] externals/auctex-cont-latexmk 09e362e9f6 006/100: fixed some silly bugs

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 09e362e9f6f48c5dc1b4beee81260da5084d9a00
Author: Paul Nelson 
Commit: Paul Nelson 

fixed some silly bugs
---
 czm-tex-compile.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index dc17f09c93..84e3bd7934 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -150,7 +150,7 @@ DIRECTION should be either \='next or \='previous."
(setq log-pos (point))
 (unless already-open
   (kill-buffer buf))
-(setq-local czm/latex-log-state (cons last-navigation-time log-pos))
+(setq-local czm-tex-compile-log-state (cons last-navigation-time log-pos))
 (when line
   (if (consp line)
  (progn
@@ -164,7 +164,7 @@ DIRECTION should be either \='next or \='previous."
  (substring search-string 3
  (search-forward truncated-search-string nil t)))
 (goto-char (point-min))
-(forward-line (1- (car line)
+(forward-line (1- line
 (message (or description "No further errors or warnings."
 
 ;;;###autoload



[elpa] externals/auctex-label-numbers 4eefdcfa69 07/12: adjust release notice

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-label-numbers
commit 4eefdcfa69d88e66647d6f4f7bf67752226ceba5
Author: Paul Nelson 
Commit: Paul Nelson 

adjust release notice
---
 tex-numbers.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tex-numbers.el b/tex-numbers.el
index 8546b175bc..2149ab07f0 100644
--- a/tex-numbers.el
+++ b/tex-numbers.el
@@ -35,9 +35,8 @@
 ;;   \\eqref include equation numbers.
 ;;
 ;; TEMPORARY NOTE: this package currently only works with the master
-;; branch of AUCTeX.  The more elaborate package
-;; https://github.com/ultronozm/czm-tex-fold.el works with released
-;; versions, but relies on advice, etc.
+;; branch of AUCTeX.  Its release is intended to be synchronized with
+;; the next release of AUCTeX.
 ;;
 ;; Activate via M-x tex-numbers-mode, or by adding to your init file:
 ;;



[elpa] externals/auctex-cont-latexmk 5473521164 036/100: tweak readme

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 5473521164630948f6b85cf58963f5a5771369e9
Author: Paul Nelson 
Commit: Paul Nelson 

tweak readme
---
 README.org | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.org b/README.org
index 95bdfe166e..17c37c7d9b 100644
--- a/README.org
+++ b/README.org
@@ -15,6 +15,6 @@ Replace the keybinding with whatever you prefer (or delete it 
and just run the c
 
 You can tweak underlying the =latexmk= command via =M-x customize-variable 
czm-tex-compile-command=.
 
-The command =czm-tex-compile-toggle= behaves the way that I prefer -- it 
enables both =czm-tex-compile-mode= and =flymake-mode=, restricting the 
backends for the latter to those coming from the former.  Depending upon your 
preferences, you may wish to write your own "wrapper" akin to 
=czm-tex-compile-toggle= for =czm-tex-compile-mode=.
+The command =czm-tex-compile-toggle= behaves the way that I prefer -- it 
enables both =czm-tex-compile-mode= and =flymake-mode=, restricting the 
backends for the latter to those coming from the former.  Depending upon your 
preferences, you may wish to write your own "wrapper" for 
=czm-tex-compile-mode= akin to =czm-tex-compile-toggle=.
 
-That's all.  I prefer this workflow to the alternative in which one compiles 
the document manually via =TeX-command-master= (=C-c C-c=) and navigates the 
warning/error messages using =next-error= (=M-n=) and =previous-error (=M-p=).  
It also gives a handy way to keep the .aux files up-to-date; I take advantage 
of this feature in the packages 
[[https://github.com/ultronozm/czm-preview.el][czm-preview.el]] and 
[[https://github.com/ultronozm/czm-tex-fold.el][czm-tex-fold.el]] to annotate 
th [...]
+That's all.  I prefer this workflow to the alternative in which one compiles 
the document manually via =TeX-command-master= (=C-c C-c=) and navigates the 
warning/error messages using =next-error= (=M-n=) and =previous-error= (=M-p=). 
 It also gives a handy way to keep the .aux files up-to-date; I take advantage 
of this feature in the packages 
[[https://github.com/ultronozm/czm-preview.el][czm-preview.el]] and 
[[https://github.com/ultronozm/czm-tex-fold.el][czm-tex-fold.el]] to annotate t 
[...]



[elpa] externals/auctex-cont-latexmk ba23a36215 092/100: typos, commentary tweaks

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit ba23a3621556bcb0713388193952803aa128412f
Author: Paul Nelson 
Commit: Paul Nelson 

typos, commentary tweaks
---
 tex-continuous.el | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tex-continuous.el b/tex-continuous.el
index fe0ac589dc..9cf37c0d7e 100644
--- a/tex-continuous.el
+++ b/tex-continuous.el
@@ -26,14 +26,14 @@
 ;; This package provides a minor mode that compiles a LaTeX document
 ;; via latexmk, reporting errors via `flymake'.
 ;;
-;; Use M-x tex-continuous-toggle to toggle the minor mode and set up
+;; Use `tex-continuous-toggle' to toggle the minor mode and set up
 ;; flymake.
 ;;
 ;; If you want to enable continuous compilation but prefer either not
 ;; to use the flymake backend or to manage it yourself (e.g., in
-;; combination with our flymake backends), then instead use M-x
-;; tex-continuous-mode and add #'tex-continuous-flymake to
-;; flymake-diagnostic-functions when you'd like.
+;; combination with other flymake backends), then instead use
+;; `tex-continuous-mode' and add #'tex-continuous-flymake to
+;; `flymake-diagnostic-functions' when you'd like.
 ;;
 ;; Customize the variable `tex-continuous-command' to change the
 ;; compilation command.



[elpa] externals/auctex-cont-latexmk 8b6924f833 038/100: fix typo and tweak README.org

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 8b6924f833a114418c11cdcd6c349087aee118a8
Author: Paul Nelson 
Commit: Paul Nelson 

fix typo and tweak README.org
---
 README.org | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.org b/README.org
index 089d385feb..9cb1169ed5 100644
--- a/README.org
+++ b/README.org
@@ -13,10 +13,10 @@ Download this repository, install using =M-x 
package-install-file= (or package-v
 #+end_src
 Replace the keybinding with whatever you prefer (or delete it and just run the 
command via =M-x=).
 
-You can tweak underlying the =latexmk= command via =M-x customize-variable 
czm-tex-compile-command=.
+You can tweak the underlying =latexmk= command via =M-x customize-variable 
czm-tex-compile-command=.
 
 The command =czm-tex-compile-toggle= behaves the way that I prefer -- it 
enables both =czm-tex-compile-mode= and =flymake-mode=, restricting the 
backends for the latter to those coming from the former.  Depending upon your 
preferences, you may wish to write your own "wrapper" for 
=czm-tex-compile-mode= akin to =czm-tex-compile-toggle=.
 
-The way the Flymake backend works, it will update only when the latexmk 
process reaches a "watching for changes" state and the buffer is unmodified.  
The workflow to have errors and warnings reported is to save the file and wait 
a few seconds without editing.
+The way the Flymake backend works, it will update only when the latexmk 
process reaches a "watching for changes" state and the buffer is unmodified.  
The workflow is thus to save the file and then wait a few seconds before 
editing further, then to use Flymake to navigate the errors.  I also use =(setq 
flymake-show-diagnostics-at-end-of-line t)=, which displays the error/warning 
messages in the buffer itself.
 
 That's all.  I prefer this workflow to the alternative in which one compiles 
the document manually via =TeX-command-master= (=C-c C-c=) and navigates the 
warning/error messages using =next-error= (=M-n=) and =previous-error= (=M-p=). 
 It also gives a handy way to keep the .aux files up-to-date; I take advantage 
of this feature in the packages 
[[https://github.com/ultronozm/czm-preview.el][czm-preview.el]] and 
[[https://github.com/ultronozm/czm-tex-fold.el][czm-tex-fold.el]] to annotate t 
[...]



[elpa] externals/auctex-cont-latexmk 62c2eb652a 031/100: print entire warning message (not every warning is a LaTeX warning)

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 62c2eb652a5ee3a45844988846fa1661bbce6752
Author: Paul Nelson 
Commit: Paul Nelson 

print entire warning message (not every warning is a LaTeX warning)
---
 czm-tex-compile.el | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 62d1fabe83..a58ab1eab3 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -124,7 +124,10 @@ Used for navigating LaTeX warnings in the log file."
   (description-raw (nth (if error-p 3 5) item))
   (description (if error-p description-raw
  (substring description-raw
-(length "LaTeX 
Warning: ") -1)))
+0
+;; (progn 
(string-match " Warning: " description-raw)
+;;(match-end 
0))
+-1)))
   line prefix
   region)
  (if error-p



[elpa] externals/auctex-cont-latexmk 1aee5cc114 049/100: add "ignored" user option, started rearranging

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 1aee5cc1149bd29492a363177912e69e6e16f147
Author: Paul Nelson 
Commit: Paul Nelson 

add "ignored" user option, started rearranging
---
 czm-tex-compile.el | 119 +
 1 file changed, 66 insertions(+), 53 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index e8aaf09ccc..b0ec02ab87 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -60,44 +60,59 @@
 (defvar-local czm-tex-compile--compilation-buffer-name nil
   "Name of the buffer used for LaTeX compilation.")
 
+(defun czm-tex-compile--kill-process ()
+  "Kill the LaTeX compilation process associated with the buffer.
+Also kill the timer for watching the log file."
+  (when (process-live-p czm-tex-compile--process)
+(interrupt-process czm-tex-compile--process)
+(sit-for 0.1)
+(delete-process czm-tex-compile--process))
+  (when (get-buffer czm-tex-compile--compilation-buffer-name)
+(kill-buffer czm-tex-compile--compilation-buffer-name))
+  (when czm-tex-compile--log-watch-timer
+(cancel-timer czm-tex-compile--log-watch-timer)
+(setq czm-tex-compile--log-watch-timer nil)))
+
 ;;;###autoload
 (define-minor-mode czm-tex-compile-mode
   "If enabled, run LaTeX compilation on the current buffer."
   :lighter nil
-  (if czm-tex-compile-mode
-  (let ((name (and (string-match "\\([^\.]+\\)\.tex" (buffer-name))
-   (match-string 1 (buffer-name)
-(unless name
-  (user-error "Buffer name does not match expected pattern"))
-(when (process-live-p czm-tex-compile--process)
-  (interrupt-process czm-tex-compile--process)
-  (sit-for 0.1)
-  (delete-process czm-tex-compile--process))
-(setq czm-tex-compile--compilation-buffer-name (concat 
"*czm-tex-compile-" (expand-file-name name)
-   "*"))
-(let ((command (concat czm-tex-compile-command " " name ".tex")))
-  (setq czm-tex-compile--process
-(start-process-shell-command
- "czm-tex-compile" czm-tex-compile--compilation-buffer-name
- command)))
-(let ((current-buf (current-buffer)))
-  (with-current-buffer (get-buffer 
czm-tex-compile--compilation-buffer-name)
-(special-mode)
-(setq-local czm-tex-compile--parent-buffer current-buf)
-(local-set-key (kbd "TAB")
-   (lambda ()
- (interactive)
- (set-window-buffer (selected-window) 
czm-tex-compile--parent-buffer)
-(add-hook 'kill-buffer-hook 'czm-tex-compile--kill-process nil t)
-(add-hook 'flymake-diagnostic-functions #'czm-tex-compile-flymake nil 
t)
-(when czm-tex-compile--log-watch-timer
-  (cancel-timer czm-tex-compile--log-watch-timer)
-  (setq czm-tex-compile--log-watch-timer nil))
-(setq czm-tex-compile--log-watch-timer
-  (run-with-timer 2 1 #'czm-tex-compile-report-if-fresh)))
+  (cond
+   (czm-tex-compile-mode
+(let ((name (and (string-match "\\([^\.]+\\)\.tex" (buffer-name))
+ (match-string 1 (buffer-name)
+  (unless name
+(user-error "Buffer name does not match expected pattern"))
+  (when (process-live-p czm-tex-compile--process)
+(interrupt-process czm-tex-compile--process)
+(sit-for 0.1)
+(delete-process czm-tex-compile--process))
+  (setq czm-tex-compile--compilation-buffer-name (concat 
"*czm-tex-compile-" (expand-file-name name)
+ "*"))
+  (let ((command (concat czm-tex-compile-command " " name ".tex")))
+(setq czm-tex-compile--process
+  (start-process-shell-command
+   "czm-tex-compile" czm-tex-compile--compilation-buffer-name
+   command)))
+  (let ((current-buf (current-buffer)))
+(with-current-buffer (get-buffer 
czm-tex-compile--compilation-buffer-name)
+  (special-mode)
+  (setq-local czm-tex-compile--parent-buffer current-buf)
+  (local-set-key (kbd "TAB")
+ (lambda ()
+   (interactive)
+   (set-window-buffer (selected-window) 
czm-tex-compile--parent-buffer)
+  (add-hook 'kill-buffer-hook 'czm-tex-compile--kill-process nil t)
+  (add-hook 'flymake-diagnostic-functions #'czm-tex-compile-flymake nil t)
+  (when czm-tex-compile--log-watch-timer
+(cancel-timer czm-tex-compile--log-watch-timer)
+(setq czm-tex-compile--log-watch-timer nil))
+  (setq czm-tex-compile--log-watch-timer
+(run-with-timer 2 1 #'czm-tex-compile-report-if-fresh
+   (t
 (czm-tex-compile--kill-process)
 (when czm-tex-compile--report-fn
-  (setq czm-tex-compile--report-fn nil
+  (setq czm-t

[elpa] externals/auctex-cont-latexmk 08d713ef4b 017/100: improve handling of some failure cases

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 08d713ef4bbdf781ea9105f838fad25c65817c02
Author: Paul Nelson 
Commit: Paul Nelson 

improve handling of some failure cases
---
 czm-tex-compile.el | 106 +
 1 file changed, 59 insertions(+), 47 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index b13a2bacd5..f3a858bf0a 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -92,52 +92,58 @@ Used for navigating LaTeX warnings in the log file."
   "Helper function to navigate warnings in the log file.
 DIRECTION should be either \='next or \='previous."
   (let* ((tex-file (buffer-file-name))
-(log-file (concat (file-name-sans-extension tex-file) ".log"))
-(already-open (find-buffer-visiting log-file))
-(buf (or already-open (find-file-noselect log-file)))
-(file-modification-time (nth 5 (file-attributes log-file)))
-(last-navigation-time (car czm-tex-compile--log-state))
-(log-pos (cdr czm-tex-compile--log-state))
-line description)
+   (log-file (concat (file-name-sans-extension tex-file)
+   ".log"))
+   (already-open (find-buffer-visiting log-file))
+   (buf (or already-open (find-file-noselect log-file)))
+   (file-modification-time (nth 5 (file-attributes log-file)))
+   (last-navigation-time (car czm-tex-compile--log-state))
+   (log-pos (cdr czm-tex-compile--log-state))
+   line description)
 (with-current-buffer buf
   (save-excursion)
   (if (or (null last-navigation-time)
- (time-less-p last-navigation-time file-modification-time))
- (goto-char (if (eq direction 'previous) (point-max) (point-min)))
-   (goto-char log-pos))
+(time-less-p last-navigation-time file-modification-time))
+(goto-char (if (eq direction 'previous)
+ (point-max)
+   (point-min)))
+  (goto-char log-pos))
   (let ((search-fn
-(if (eq direction 'previous) #'re-search-backward 
#'re-search-forward)))
+   (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)
+  (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 (when (match-string 1)
+ (string-to-number (match-string 1
+  (line-prefix 
(buffer-substring-no-properties
+  
(po

[elpa] externals/auctex-cont-latexmk 1ffdaaf722 080/100: Add some clarifications and remarks to the readme

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 1ffdaaf72231e1694d3e3fe6fc9fb79c4160d1df
Author: Paul Nelson 
Commit: Paul Nelson 

Add some clarifications and remarks to the readme

* README.org (Configuration):
---
 README.org | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/README.org b/README.org
index 0c49a6b33e..ffa0f6d9b0 100644
--- a/README.org
+++ b/README.org
@@ -17,7 +17,7 @@ Replace the keybinding with whatever you prefer (or delete it 
and just run the c
 
 The command =tex-continuous-toggle= behaves the way that I prefer -- it 
enables both =tex-continuous-mode= and =flymake-mode=, restricting the backends 
for the latter to those coming from the former.  Depending upon your 
preferences, you may wish to write your own "wrapper" for =tex-continuous-mode= 
akin to =tex-continuous-toggle=.
 
-The way the Flymake backend works, it will update only when the latexmk 
process reaches a "watching for changes" state and the buffer is unmodified.  
The workflow is thus to save the file, wait a few seconds for the compilation 
to complete, and then to use Flymake to navigate the errors.  I configure 
Flymake to use =M-n= and =M-p= for navigation, and also use =(setq 
flymake-show-diagnostics-at-end-of-line t)=, which displays the error/warning 
messages in the buffer itself rather than jus [...]
+The way the Flymake backend works, it will update only when the latexmk 
process reaches a "watching for changes" state and the buffer is unmodified.  
The workflow is thus to save the file, wait a few seconds for the compilation 
to complete, and then to use Flymake to navigate the errors.  I configure 
Flymake to use =M-n= and =M-p= for navigation, and also use =(setq 
flymake-show-diagnostics-at-end-of-line t)= (available in Flymake 1.3.6, part 
of Emacs 30+), which displays the error/warni [...]
 
 #+begin_src elisp
 (use-package flymake
@@ -29,6 +29,10 @@ The way the Flymake backend works, it will update only when 
the latexmk process
 ("M-p" . flymake-goto-prev-error)))
 #+end_src
 
+I also bind =flymake-show-diagnostics-buffer=, which gives an overview of all 
errors.  You can find my current setup in 
[[https://github.com/ultronozm/emacsd/blob/main/init-main.el][my config]].
+
+Let me remark that TeX compilers are not so good at locating errors involving 
braces.  For this, the Emacs commands =check-parens=, =tex-validate-buffer= and 
=tex-validate-region= are indispensable.
+
 That's all.  I prefer this workflow to the alternative in which one compiles 
the document manually via =TeX-command-master= (=C-c C-c=) and navigates the 
warning/error messages using =next-error= (=M-n=) and =previous-error= (=M-p=). 
 It also gives a handy way to keep the .aux files up-to-date; I take advantage 
of this feature in the packages 
[[https://github.com/ultronozm/czm-preview.el][czm-preview.el]] and 
[[https://github.com/ultronozm/czm-tex-fold.el][czm-tex-fold.el]] to annotate t 
[...]
 
 * Customization



[elpa] externals/auctex-cont-latexmk a2708e8739 090/100: Fix error involving new indirect buffers

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit a2708e8739401131e6b94b5569033eb1fd2fc8a3
Author: Paul Nelson 
Commit: Paul Nelson 

Fix error involving new indirect buffers

* tex-continuous.el (tex-continuous--clone-indirect-buffer-hook): New
function.
(tex-continuous--clone-indirect-buffer-hook): Use it.

Previously, backends from a base buffer were propagated to a new
indirect buffer.  When called, they would yield the following error,
coming from `flymake--publish-diagnostics':

Error running timer ‘tex-continuous--timer-function’: (cl-assertion-failed 
(stringp (flymake--diag-locus d)))
---
 tex-continuous.el | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/tex-continuous.el b/tex-continuous.el
index 834daab224..2585d07a6e 100644
--- a/tex-continuous.el
+++ b/tex-continuous.el
@@ -249,6 +249,10 @@ either in a watching state or has not updated recently."
 (defvar-local tex-continuous--report-fn nil
   "Function provided by Flymake for reporting diagnostics.")
 
+(defun tex-continuous--clone-indirect-buffer-hook ()
+  "Set `tex-continuous--report-fn' to nil after cloning an indirect buffer."
+  (setq tex-continuous--report-fn nil))
+
 (defun tex-continuous-flymake (report-fn &rest _args)
   "Flymake backend for LaTeX based on latexmk.
 Save REPORT-FN in a local variable, called by `tex-continuous--timer' to
@@ -373,6 +377,7 @@ Also set `flymake-diagnostic-functions' to 
`tex-continuous-flymake'."
   (setq-local flymake-diagnostic-functions '(tex-continuous-flymake))
   (flymake-mode 1)
   (setq tex-continuous--disable-function 'tex-continuous-turn-off)
+  (add-hook 'clone-indirect-buffer-hook 
#'tex-continuous--clone-indirect-buffer-hook nil t)
   (message "tex-continuous-mode and flymake-mode enabled"))
 
 (defun tex-continuous-turn-off ()
@@ -381,6 +386,7 @@ Also restore `flymake-diagnostic-functions'."
   (interactive)
   (tex-continuous-mode 0)
   (flymake-mode 0)
+  (remove-hook 'clone-indirect-buffer-hook 
#'tex-continuous--clone-indirect-buffer-hook t)
   (setq-local flymake-diagnostic-functions
   tex-continuous--saved-flymake-diagnostic-functions)
   (message "tex-continuous-mode and flymake-mode disabled"))



[elpa] externals/auctex-cont-latexmk 2762ee8084 037/100: polish

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 2762ee8084f202bcadd7dbad6988039b98315bf1
Author: Paul Nelson 
Commit: Paul Nelson 

polish
---
 README.org |   2 +
 czm-tex-compile.el | 189 +++--
 2 files changed, 85 insertions(+), 106 deletions(-)

diff --git a/README.org b/README.org
index 17c37c7d9b..089d385feb 100644
--- a/README.org
+++ b/README.org
@@ -17,4 +17,6 @@ You can tweak underlying the =latexmk= command via =M-x 
customize-variable czm-t
 
 The command =czm-tex-compile-toggle= behaves the way that I prefer -- it 
enables both =czm-tex-compile-mode= and =flymake-mode=, restricting the 
backends for the latter to those coming from the former.  Depending upon your 
preferences, you may wish to write your own "wrapper" for 
=czm-tex-compile-mode= akin to =czm-tex-compile-toggle=.
 
+The way the Flymake backend works, it will update only when the latexmk 
process reaches a "watching for changes" state and the buffer is unmodified.  
The workflow to have errors and warnings reported is to save the file and wait 
a few seconds without editing.
+
 That's all.  I prefer this workflow to the alternative in which one compiles 
the document manually via =TeX-command-master= (=C-c C-c=) and navigates the 
warning/error messages using =next-error= (=M-n=) and =previous-error= (=M-p=). 
 It also gives a handy way to keep the .aux files up-to-date; I take advantage 
of this feature in the packages 
[[https://github.com/ultronozm/czm-preview.el][czm-preview.el]] and 
[[https://github.com/ultronozm/czm-tex-fold.el][czm-tex-fold.el]] to annotate t 
[...]
diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 72d6db3a0a..11259d5647 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2023  Paul D. Nelson
 
 ;; Author: Paul D. Nelson 
-;; Version: 0.0
+;; Version: 0.1
 ;; URL: https://github.com/ultronozm/czm-tex-compile.el
 ;; Package-Requires: ((emacs "29.1") (auctex))
 ;; Keywords: tex
@@ -24,9 +24,9 @@
 ;;; Commentary:
 
 ;; This package provides a minor mode that compiles a LaTeX document
-;; via latexmk and reports errors and warnings to a `flymake' backend.
-;; Customize the variable `czm-tex-compile-command' to change the
-;; command used to compile the document.
+;; via latexmk, reporting errors via `flymake'.  Customize the
+;; variable `czm-tex-compile-command' to change the command used to
+;; compile the document.
 ;;
 ;; My use-package declaration:
 ;;
@@ -49,83 +49,90 @@
   "Command to compile LaTeX documents."
   :type 'string)
 
-(defvar-local czm-tex-compile-process nil
+(defvar-local czm-tex-compile--process nil
   "Process running the LaTeX compilation.")
 
-(defvar-local czm-tex-compile-log-watch-descriptor nil)
-(defvar-local czm-tex-compile-report-fn nil)
-(defvar-local czm-tex-compile-log-watch-timer nil)
-(defvar-local czm-tex-compile--compilation-buffer-name nil)
+(defvar-local czm-tex-compile--report-fn nil
+  "Function provided by Flymake for reporting diagnostics.")
+
+(defvar-local czm-tex-compile--log-watch-timer nil
+  "Timer for reporting changes to the log file.")
+
+(defvar-local czm-tex-compile--compilation-buffer-name nil
+  "Name of the buffer used for LaTeX compilation.")
 
 ;;;###autoload
 (define-minor-mode czm-tex-compile-mode
   "If enabled, run LaTeX compilation on the current buffer."
-  :lighter " TexC"
+  :lighter nil
   (if czm-tex-compile-mode
   (let ((name (and (string-match "\\([^\.]+\\)\.tex" (buffer-name))
(match-string 1 (buffer-name)
 (unless name
   (user-error "Buffer name does not match expected pattern"))
-(when (process-live-p czm-tex-compile-process)
-  (interrupt-process czm-tex-compile-process)
+(when (process-live-p czm-tex-compile--process)
+  (interrupt-process czm-tex-compile--process)
   (sit-for 0.1)
-  (delete-process czm-tex-compile-process))
-(setq czm-tex-compile--compilation-buffer-name (concat 
"*czm-tex-compile-" name "*"))
+  (delete-process czm-tex-compile--process))
+(setq czm-tex-compile--compilation-buffer-name (concat 
"*czm-tex-compile-" (expand-file-name name)
+   "*"))
 (let ((command (concat czm-tex-compile-command " " name ".tex")))
-  (setq czm-tex-compile-process
+  (setq czm-tex-compile--process
 (start-process-shell-command "czm-tex-compile" 
czm-tex-compile--compilation-buffer-name
  command)))
 (add-hook 'kill-buffer-hook 'czm-tex-compile--kill-process nil t)
-(add-hook 'flymake-diagnostic-functions #'czm-tex-compile-flymake nil 
t))
+(add-hook 'flymake-diagnostic-functions #'czm-tex-compile-flymake nil 
t)
+(when czm-tex-compile--log-watch-timer
+  (cancel-timer czm-tex-compile--log-watch-timer)
+  (setq czm-tex-comp

[elpa] branch externals/auctex-label-numbers created (now 92d855b4ef)

2024-06-06 Thread ELPA Syncer
elpasync pushed a change to branch externals/auctex-label-numbers.

at  92d855b4ef Add note of  externaldocument shortcoming

This branch includes the following new commits:

   new  235bc005b2 Initial commit
   new  462f9bf626 Add files via upload
   new  18a001df85 fix URL
   new  f11407452f incorporate feedback from Arash
   new  0132eacc48 add annotations for completion-at-point inside \ref, 
\eqref
   new  4a53df7fce simplify capf label annotation using advice
   new  4eefdcfa69 adjust release notice
   new  71e97e97b7 clean up, bump version, add readme details
   new  78abc0d797 swap cl for seq
   new  38f3bc735d fix regexp pattern
   new  30919ac12f rename to auctex-label-numbers.el
   new  92d855b4ef Add note of  externaldocument shortcoming




[elpa] externals/auctex-label-numbers 462f9bf626 02/12: Add files via upload

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-label-numbers
commit 462f9bf626d3f6c951905d37c1f8aaddf50cbc3b
Author: Paul Nelson <63298781+ultron...@users.noreply.github.com>
Commit: GitHub 

Add files via upload
---
 tex-numbers.el | 224 +
 1 file changed, 224 insertions(+)

diff --git a/tex-numbers.el b/tex-numbers.el
new file mode 100644
index 00..4eea0dcfa9
--- /dev/null
+++ b/tex-numbers.el
@@ -0,0 +1,224 @@
+;;; tex-numbers.el --- numbering for LaTeX previews and folds  -*- 
lexical-binding: t; -*-
+
+;; Copyright (C) 2024  Paul D. Nelson
+
+;; Author: Paul D. Nelson 
+;; Version: 0.0
+;; URL: https://github.com/ultronozm/czm-preview.el
+;; Package-Requires: ((emacs "26.1") (auctex))
+;; Keywords: tex
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see .
+
+;;; Commentary:
+
+;; This package augments the preview and folding features of AUCTeX:
+;; previews of labeled equations are numbered as in the compiled
+;; document, and the the macros \\ref, \\eqref, and \\label are folded
+;; with the corresponding numbers.
+;;
+;; Install via TODO.
+;;
+;; TEMPORARY NOTE: this package currently only works with the master
+;; branch of AUCTeX.  The more elaborate package
+;; https://github.com/ultronozm/czm-tex-fold.el works with released
+;; versions, but relies on advice, etc.
+;;
+;; Activate via M-x tex-numbers-mode, or by adding to your init file:
+;;
+;; (use-package tex-numbers
+;;   :hook
+;;   (LaTeX-mode . tex-numbers-mode))
+;;
+;; The package provides an interface for retrieving label numbers in
+;; LaTeX documents.  This interface is used to implement a global
+;; minor mode, `tex-numbers-mode', which enables the noted features.
+;;
+;; The label numbers are retrieved from the aux file of the compiled
+;; document.  To update them, one should compile the document,
+;; regenerate the previews and refresh the folds.
+;;
+;; By customizing the variable `tex-numbers-label-to-number-function', one
+;; can specify a different way to retrieve label numbers, e.g., by
+;; querying an LSP server.
+
+;;; Code:
+
+(require 'tex)
+(require 'latex)
+(require 'tex-fold)
+(require 'preview)
+
+(defgroup tex-numbers nil
+  "Numbering for LaTeX previews and folds."
+  :group 'AUCTeX)
+
+(defvar tex-numbers-cache (make-hash-table :test 'equal)
+  "Cache of label numbers from aux files.
+The keys are aux file names.  The values are hash tables, mapping label
+strings to label number strings.")
+
+(defun tex-numbers-update-cache (aux-file)
+  "Update the cache for AUX-FILE.
+Return the updated cache, or nil if the aux file does not exist."
+  (when (file-exists-p aux-file)
+(with-temp-buffer
+  (insert-file-contents aux-file)
+  (let ((cache (make-hash-table :test 'equal))
+(pattern "\\newlabel{\\([^}]+\\)}{{\\([^}]+\\)}"))
+(save-excursion
+  (goto-char (point-min))
+  (while (re-search-forward pattern nil t)
+(let ((label (match-string 1))
+  (number (match-string 2)))
+  (puthash label number cache
+(puthash 'timestamp (current-time) cache)
+(puthash aux-file cache tex-numbers-cache)
+cache
+
+(defun tex-numbers-label-to-number-helper (label aux-file)
+  "Get the number of LABEL from the aux file AUX-FILE.
+Check the cache first, and update it if the aux file has changed.
+Return the label number as a string, or nil if the label cannot be
+found."
+  (let ((cache (gethash aux-file tex-numbers-cache)))
+(if (or (not cache)
+(time-less-p (gethash 'timestamp cache)
+ (nth 5 (file-attributes aux-file
+(setq cache (tex-numbers-update-cache aux-file)))
+(when cache
+  (gethash label cache
+
+(defcustom tex-numbers-label-to-number-function nil
+  "Function to retrieve label numbers.
+If non-nil, `tex-numbers-label-to-number' delegates to this function.
+The function should take a label string as its argument and return the
+corresponding label number as a string, or nil if that number cannot be
+retrieved."
+  :type '(choice (const :tag "Default" nil) function)
+  :group 'tex-numbers)
+
+(defun tex-numbers-label-to-number (label)
+  "Get number of LABEL for current tex buffer.
+If the buffer does not point to a file, or if the corresponding
+aux file does not exist, or if the label cannot be found, then
+

[elpa] externals/auctex-cont-latexmk 6d8252a759 014/100: avoid unnecessary "find-file-noselect"

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 6d8252a759976e347d8938c7fe9e592fd2fde9de
Author: Paul Nelson 
Commit: Paul Nelson 

avoid unnecessary "find-file-noselect"
---
 czm-tex-compile.el | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 924a485419..92909d43c7 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -108,13 +108,12 @@ Used for navigating LaTeX warnings in the log file."
 DIRECTION should be either \='next or \='previous."
   (let* ((tex-file (buffer-file-name))
 (log-file (concat (file-name-sans-extension tex-file) ".log"))
-(already-open (find-buffer-visiting log-file))
-(buf (or already-open (find-file-noselect log-file)))
 (file-modification-time (nth 5 (file-attributes log-file)))
 (last-navigation-time (car czm-tex-compile--log-state))
 (log-pos (cdr czm-tex-compile--log-state))
 line description)
-(with-current-buffer buf
+(with-temp-buffer
+  (insert-file-contents log-file)
   (save-excursion)
   (if (or (null last-navigation-time)
  (time-less-p last-navigation-time file-modification-time))
@@ -161,8 +160,6 @@ DIRECTION should be either \='next or \='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))
 (when line
   (let ((pos



[elpa] externals/auctex-cont-latexmk 2639003039 059/100: tweaks

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 26390030397a818872f717dcec56c93bb03136cd
Author: Paul Nelson 
Commit: Paul Nelson 

tweaks
---
 czm-tex-compile.el | 25 +
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 281b2573cd..7a5e353ecd 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -46,7 +46,7 @@
   :group 'tex)
 
 (defcustom czm-tex-compile-command
-  "latexmk -shell-escape -pvc -pdf -view=none -e '$pdflatex=q/pdflatex %O 
-synctex=1 -interaction=nonstopmode %S/'"
+  "latexmk -pvc -shell-escape -pdf -view=none -e '$pdflatex=q/pdflatex %O 
-synctex=1 -interaction=nonstopmode %S/'"
   "Command to compile LaTeX documents."
   :type 'string
   :group 'czm-tex-compile)
@@ -178,7 +178,7 @@ cell (BEG . END) indicating where the error happens."
 (defun czm-tex-compile--compilation-buffer-name ()
   "Return the name of the buffer used for LaTeX compilation."
   (let ((master (abbreviate-file-name (expand-file-name (TeX-master-file)
-(format "*tex-pvc-%s*" master)))
+(format "*pvc-%s*" master)))
 
 (defun czm-tex-compile--compilation-buffer ()
   "Return the buffer used for LaTeX compilation."
@@ -241,17 +241,18 @@ e`czm-tex-compile--timer' to report diagnostics."
   :lighter nil
   (cond
(czm-tex-compile-mode
-(if-let ((comp-buf (czm-tex-compile--compilation-buffer)))
-(let ((buf (current-buffer)))
+(let ((buf (current-buffer)))
+  (if-let ((comp-buf (czm-tex-compile--compilation-buffer)))
   (with-current-buffer comp-buf
-(push buf czm-tex-compile--subscribed-buffers)))
-  (unless (start-process-shell-command
-   "czm-tex-compile"
-   (czm-tex-compile--compilation-buffer-name)
-   (czm-tex-compile--compilation-command))
-(error "Failed to start LaTeX compilation"))
-  (with-current-buffer (czm-tex-compile--compilation-buffer)
-(special-mode)))
+(push buf czm-tex-compile--subscribed-buffers))
+(unless (start-process-shell-command
+ "czm-tex-compile"
+ (czm-tex-compile--compilation-buffer-name)
+ (czm-tex-compile--compilation-command))
+  (error "Failed to start LaTeX compilation"))
+(with-current-buffer (czm-tex-compile--compilation-buffer)
+  (special-mode)
+  (push buf czm-tex-compile--subscribed-buffers
 (add-hook 'kill-buffer-hook 'czm-tex-compile--unsubscribe nil t)
 (add-hook 'flymake-diagnostic-functions #'czm-tex-compile-flymake nil t)
 (when czm-tex-compile--timer



[elpa] externals/auctex-cont-latexmk 1c5248a3ac 087/100: expand README tips

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 1c5248a3aceadb6e93496c95c866ae33a45ef46e
Author: Paul Nelson 
Commit: Paul Nelson 

expand README tips
---
 README.org | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.org b/README.org
index dd64c0a7a0..0b4a80544d 100644
--- a/README.org
+++ b/README.org
@@ -34,7 +34,7 @@ I also bind =flymake-show-diagnostics-buffer=, which gives an 
overview of all er
 That's all.  I prefer this workflow to the alternative in which one compiles 
the document manually via =TeX-command-master= (=C-c C-c=) and navigates the 
warning/error messages using =next-error= (=M-n=) and =previous-error= (=M-p=). 
 It also gives a handy way to keep the .aux files up-to-date; I take advantage 
of this feature in the packages 
[[https://github.com/ultronozm/czm-preview.el][czm-preview.el]] and 
[[https://github.com/ultronozm/czm-tex-fold.el][czm-tex-fold.el]] to annotate t 
[...]
 
 * Tips
-- TeX compilers are not so good at locating errors involving braces.  For 
this, the Emacs commands =check-parens=, =tex-validate-buffer= and 
=tex-validate-region= are indispensable.
+- TeX compilers are not so good at locating errors involving braces.  For 
this, the Emacs commands =check-parens=, =tex-validate-buffer= and 
=tex-validate-region= are indispensable.  In particular, you should always try 
these commands when you encounter errors at the bottom of a file concerning an 
incomplete argument or environment.
 - You can use the command =M-x tex-continuous-help-at-point= (or bind it to a 
key) if you want to see AUCTeX's help message (if any) for the error at point.
 
 * Customization



[elpa] externals/auctex-cont-latexmk 146dfe2350 019/100: Merge remote-tracking branch 'origin/main'

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 146dfe235088049acc20949eee0d2c30fd384fad
Merge: 447b9f3be2 d052e767e6
Author: Paul Nelson 
Commit: Paul Nelson 

Merge remote-tracking branch 'origin/main'
---
 .gitignore |  1 +
 README.org | 23 +++
 czm-tex-compile.el | 47 ---
 3 files changed, 56 insertions(+), 15 deletions(-)

diff --git a/.gitignore b/.gitignore
index 206569dc66..7ab62451bb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,4 @@
 
 # Undo-tree save-files
 *.~undo-tree
+/*.html
diff --git a/README.org b/README.org
new file mode 100644
index 00..f43bd2fce5
--- /dev/null
+++ b/README.org
@@ -0,0 +1,23 @@
+#+title: czm-preview.el: Convenience functions for compiling LaTeX
+#+author: Paul Nelson
+
+* Overview
+This package provides convenience functions that support a LaTeX workflow 
where =latexmk= continuously compiles the document in the background.
+
+* Configuration
+Download this repository, install using =M-x package-install-file= (or 
package-vc-install, straight, elpaca, ...), and add something like the 
following to your [[https://www.emacswiki.org/emacs/InitFile][init file]]:
+#+begin_src elisp
+(use-package czm-tex-compile
+:bind
+("C-c k" . czm-tex-compile)
+("s-]" . czm-tex-compile-next-error)
+("s-[" . czm-tex-compile-previous-error))
+#+end_src
+Replace the keybindings with whatever you prefer (or delete them and just run 
the commands via =M-x=).
+
+* Usage
+
+- If you run =czm-tex-compile= in a TeX buffer visiting "foo.tex", it starts 
an =eshell= buffer =*eshell-foo*= in the background that continuously compiles 
the current document.  Use =M-x customize-variable czm-tex-compile-command= to 
customize the compilation command.  If you run the same command again, then it 
switches to the =eshell= buffer.
+- =czm-tex-compile-next-error= and =czm-tex-compile-previous-error= navigate 
the error and warning messages encountered in the log file produced by 
=latexmk=, jumping to the corresponding positions in the tex buffer.
+
+That's all.  I prefer this workflow to the alternative in which one compiles 
the document manually via =TeX-command-master= (=C-c C-c=) and navigates the 
warning/error messages using =next-error= (=M-n=) and =previous-error (=M-p=).  
It also gives a handy way to keep the .aux files up-to-date; I take advantage 
of this feature in the packages 
[[https://github.com/ultronozm/czm-preview.el][czm-preview.el]] and 
[[https://github.com/ultronozm/czm-tex-fold.el][czm-tex-fold.el]] to annotate 
th [...]
diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 5553dfefa1..eafc85f0c9 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -1,11 +1,11 @@
-;;; czm-tex-compile.el --- Convenience functions compiling LaTeX  -*- 
lexical-binding: t; -*-
+;;; czm-tex-compile.el --- Convenience functions for compiling LaTeX  -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2023  Paul D. Nelson
 
 ;; Author: Paul D. Nelson 
 ;; Version: 0.0
 ;; URL: https://github.com/ultronozm/czm-tex-compile.el
-;; Package-Requires: ((emacs "29.1") (auctex "11.86.1"))
+;; Package-Requires: ((emacs "29.1"))
 ;; Keywords: tex
 
 ;; This program is free software; you can redistribute it and/or modify
@@ -50,6 +50,17 @@
   :type 'string
   :group 'czm-tex-compile)
 
+(defun czm-tex-compile--kill-buffer-hook ()
+  "Hook to kill the eshell buffer when the LaTeX buffer is killed."
+  (when (string-match "\\([^\.]+\\)\.tex" (buffer-name))
+(let* ((name (match-string 1 (buffer-name)))
+   (bufname (concat "*eshell-" name "*")))
+  (when (get-buffer bufname)
+(let ((kill-buffer-query-functions '()))
+  (with-current-buffer bufname
+(eshell-interrupt-process))
+  (kill-buffer bufname))
+
 ;;;###autoload
 (defun czm-tex-compile ()
   "Compile the current LaTeX document in an eshell buffer.
@@ -64,6 +75,7 @@ name of the current LaTeX file."
   (if (get-buffer bufname)
  (switch-to-buffer bufname)
(save-window-excursion
+  (add-hook 'kill-buffer-hook #'czm-tex-compile--kill-buffer-hook)
  (eshell "new")
  (rename-buffer bufname)
  (insert (concat czm-tex-compile-command " " name ".tex"))
@@ -84,23 +96,22 @@ Used for navigating LaTeX warnings in the log file."
 
 ;; TODO: look for the line .bbl in the file, and don't jump to
 ;; line numbers found in log entries beyond that point (just display
-;; them).  Also, use insert-file-contents rather than
-;; find-file-noselect, etc.  Similarly, do the same for .aux files in
-;; your other packages (tex-util, preview).
+;; them).
+
+(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."
   (let* ((tex-file (buffer-file-name))
-   (log-file

[elpa] externals/auctex-cont-latexmk d2f6dbaae4 073/100: correct use-package declaration

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit d2f6dbaae49c4ed2ddc93fcefca527046ce86d9e
Author: Paul Nelson 
Commit: Paul Nelson 

correct use-package declaration
---
 README.org | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/README.org b/README.org
index c6abe8c0ed..731f0f0294 100644
--- a/README.org
+++ b/README.org
@@ -9,7 +9,8 @@ Download this repository, install using =M-x 
package-install-file= (or package-v
 #+begin_src elisp
 (use-package tex-continuous
   :bind
-  ("C-c k" . tex-continuous-toggle))
+  (:map LaTeX-mode-map
+("C-c k" . tex-continuous-toggle)))
 #+end_src
 Replace the keybinding with whatever you prefer (or delete it and just run the 
command via =M-x=).
 



[elpa] externals/exwm 9e965fd2af: satisfy checkdoc

2024-06-06 Thread ELPA Syncer
branch: externals/exwm
commit 9e965fd2afefcbbcab78081ef5ecffce2c7a817b
Author: Nicholas Vollmer 
Commit: Daniel Mendler 

satisfy checkdoc

* exwm-background.el (exwm-background--connected-p): Add docstring.
(exwm-background--connect): Add docstring.
* exwm-core.el (exwm-debug-log-time-function):
(exwm-debug): Rename to exwm-debug-mode; define obsolete alias for old name.
(exwm--debug): Update docstring to reflect above name change.
(exwm--log): condition on exwm-debug-mode
(exwm-mode-map): update exwm-debug-mode binding
* exwm-floating.el (exwm-floating--set-allowed-actions):
Rename TILLING parameter to TILED-P; update docstring.
(exwm-floating--start-moveresize): Add parameters to docstring.
(exwm-floating--do-moveresize): Add parameter to docstring.
* exwm-input.el (exwm-input-prefix-keys): Remove embedded keybinding from 
docstring.
(exwm-input--on-PropertyNotify): Add parameter to docstring.
(exwm-input--on-EnterNotify): Add parameter to docstring.
(exwm-input--on-keysyms-update): Add docstring.
(exwm-input--set-active-window): Add parameter to docstring.
(exwm-input--on-ButtonPress): Add parameter to docstring.
(exwm-input--on-KeyPress): Add parameter to docstring.
(exwm-input--on-CreateNotify): Add parameter to docstring.
(exwm-input--grab-global-prefix-keys): Add docstring.
(exwm-input--set-key): Add docstring.
(exwm-input-set-key): Add parameter to docstring.
(exwm-input--unread-event): Add docstring.
(exwm-input--translate): Add docstring.
(exwm-input--cache-event): Add parameter to docstring.
(exwm-input--on-KeyPress-line-mode): Rename parameter; add parameter to 
docstring.
(exwm-input--on-KeyPress-char-mode): Rename parameter; add parameter to 
docstring.
(exwm-input-grab-keyboard): Add parameter to docstring.
(exwm-input-release-keyboard): Add parameter to docstring.
(exwm-input-toggle-keyboard): Add parameter to docstring.
(exwm-input-send-next-key): Rename parameter; mention limit in docstring.
(exwm-input--set-simulation-keys): Rename parameter; add parameter to 
docstring.
(exwm-input--read-keys): Add docstring.
(exwm-input-set-simulation-key): Add parameters to docstring.
(exwm-input-send-simulation-key): Rename parameter; add parameter to 
docstring.
* exwm-randr.el (exwm-randr--on-ScreenChangeNotify): Add parameter to 
docstring.
(exwm-randr--on-Notify): Add parameter to docstring.
(exwm-randr--on-ConfigureNotify): Add parameter to docstring.
* exwm-xim.el (exwm-xim--on-ClientMessage): Add parameter to docstring.
* exwm.el (exwm-restart): Remove question mark from prompt arg
(exwm-enable): Remove question mark from prompt arg; add parameter to 
docstring.
(exwm--confirm-kill-terminal): Remove question mark from prompt arg.
(exwm--confirm-kill-emacs): Ensure prompt ends in question mark.
---
 exwm-background.el |  2 ++
 exwm-core.el   | 15 -
 exwm-floating.el   | 13 +---
 exwm-input.el  | 90 ++
 exwm-randr.el  |  6 ++--
 exwm-xim.el|  2 +-
 exwm.el| 11 ---
 7 files changed, 79 insertions(+), 60 deletions(-)

diff --git a/exwm-background.el b/exwm-background.el
index 3a9ebd81e1..789012aea2 100644
--- a/exwm-background.el
+++ b/exwm-background.el
@@ -156,10 +156,12 @@ may kill this connection when they replace it.")
   (xcb:flush exwm-background--connection))
 
 (defun exwm-background--connected-p ()
+  "Return t if a live background connection process exists and is connected."
   (and exwm-background--connection
(process-live-p (slot-value exwm-background--connection 'process
 
 (defun exwm-background--connect ()
+  "Establish background Pixmap connection."
   (unless (exwm-background--connected-p)
 (setq exwm-background--connection (xcb:connect))
 ;;prevent query message on exit
diff --git a/exwm-core.el b/exwm-core.el
index ef5e1ecf31..8dafedfeb6 100644
--- a/exwm-core.el
+++ b/exwm-core.el
@@ -38,12 +38,12 @@
   :group 'exwm)
 
 (defcustom exwm-debug-log-time-function #'exwm-debug-log-uptime
-  "Function used for generating timestamps in `exwm-debug' logs.
+  "Function used for generating timestamps in debug log.
 
 Here are some predefined candidates:
 `exwm-debug-log-uptime': Display the uptime of this Emacs instance.
 `exwm-debug-log-time': Display time of day.
-`nil': Disable timestamp."
+nil: Disable timestamp."
   :type `(choice (const :tag "Emacs uptime" ,#'exwm-debug-log-uptime)
  (const :tag "Time of day" ,#'exwm-debug-log-time)
  (const :tag "Off" nil)
@@ -98,14 +98,15 @@ Here are some predefined candidates:
 (declare-function exwm-workspace-switch "exwm-workspace.el"
   (frame-or-index &optional force))
 
-(define-minor-mode exwm-debug
+(define-minor-mode exwm-debug-mode
   "Debug-logging enabled if non-nil."
   :global t
   :group 

[elpa] externals/auctex-cont-latexmk 30694ac352 039/100: make TAB switch from compilation buffer back to tex file

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 30694ac352b6cead9a662bdde1afea46b7dd9cc4
Author: Paul Nelson 
Commit: Paul Nelson 

make TAB switch from compilation buffer back to tex file
---
 czm-tex-compile.el | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 11259d5647..f9a1b37912 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -78,8 +78,16 @@
"*"))
 (let ((command (concat czm-tex-compile-command " " name ".tex")))
   (setq czm-tex-compile--process
-(start-process-shell-command "czm-tex-compile" 
czm-tex-compile--compilation-buffer-name
- command)))
+(start-process-shell-command
+ "czm-tex-compile" czm-tex-compile--compilation-buffer-name
+ command)))
+(let ((current-buf (current-buffer)))
+  (with-current-buffer (get-buffer 
czm-tex-compile--compilation-buffer-name)
+(special-mode)
+(local-set-key (kbd "TAB")
+   (lambda ()
+ (interactive)
+ (set-window-buffer (selected-window) 
current-buf)
 (add-hook 'kill-buffer-hook 'czm-tex-compile--kill-process nil t)
 (add-hook 'flymake-diagnostic-functions #'czm-tex-compile-flymake nil 
t)
 (when czm-tex-compile--log-watch-timer



[elpa] externals/auctex-cont-latexmk dc493bf00c 022/100: delete a couple lines that should have been deleted last time

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit dc493bf00ca29a3ce1d91b940580476c15e842d0
Author: Paul Nelson 
Commit: Paul Nelson 

delete a couple lines that should have been deleted last time
---
 czm-tex-compile.el | 2 --
 1 file changed, 2 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index eafc85f0c9..6989cb71bf 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -155,8 +155,6 @@ DIRECTION should be either \='next or \='previous."
 (forward-line -1)
   ;; (forward-line (if (eq direction 'previous) -1 1))
   (setq log-pos (point))
-(unless already-open
-  (kill-buffer buf))
 (setq-local czm-tex-compile--log-state (cons last-navigation-time log-pos))
 (when line
   (let ((pos



[elpa] externals/auctex-cont-latexmk 7c3c45f924 041/100: fix "tab goes from compilation buffer to tex buffer" feature

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 7c3c45f924c96d1ed22c051ae99a27abdd94db53
Author: Paul Nelson 
Commit: Paul Nelson 

fix "tab goes from compilation buffer to tex buffer" feature
---
 czm-tex-compile.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index f9a1b37912..f8c083934c 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -84,10 +84,11 @@
 (let ((current-buf (current-buffer)))
   (with-current-buffer (get-buffer 
czm-tex-compile--compilation-buffer-name)
 (special-mode)
+(setq-local czm-tex-compile--parent-buffer current-buf)
 (local-set-key (kbd "TAB")
(lambda ()
  (interactive)
- (set-window-buffer (selected-window) 
current-buf)
+ (set-window-buffer (selected-window) 
czm-tex-compile--parent-buffer)
 (add-hook 'kill-buffer-hook 'czm-tex-compile--kill-process nil t)
 (add-hook 'flymake-diagnostic-functions #'czm-tex-compile-flymake nil 
t)
 (when czm-tex-compile--log-watch-timer



[elpa] externals/auctex-cont-latexmk 549d8c06a7 034/100: got it in decent working shape, modulo an occasional error

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 549d8c06a7b581e1aefa42e730b2d29ca9e1c10f
Author: Paul Nelson 
Commit: Paul Nelson 

got it in decent working shape, modulo an occasional error
---
 README.org |  13 ++--
 czm-tex-compile.el | 209 +
 2 files changed, 120 insertions(+), 102 deletions(-)

diff --git a/README.org b/README.org
index b7871545ad..95bdfe166e 100644
--- a/README.org
+++ b/README.org
@@ -2,22 +2,19 @@
 #+author: Paul Nelson
 
 * Overview
-This package provides convenience functions that support a LaTeX workflow 
where =latexmk= continuously compiles the document in the background.
+This package provides a minor mode where 
[[https://ctan.org/pkg/latexmk?lang=en][latexmk]] continuously compiles the 
document in the background and the errors/warnings are reported via 
[[https://www.gnu.org/software/emacs/manual/html_node/emacs/Flymake.html][Flymake]].
 
 * Configuration
 Download this repository, install using =M-x package-install-file= (or 
package-vc-install, straight, elpaca, ...), and add something like the 
following to your [[https://www.emacswiki.org/emacs/InitFile][init file]]:
 #+begin_src elisp
 (use-package czm-tex-compile
 :bind
-("C-c k" . czm-tex-compile)
-("s-]" . czm-tex-compile-next-error)
-("s-[" . czm-tex-compile-previous-error))
+("C-c k" . czm-tex-compile-toggle))
 #+end_src
-Replace the keybindings with whatever you prefer (or delete them and just run 
the commands via =M-x=).
+Replace the keybinding with whatever you prefer (or delete it and just run the 
command via =M-x=).
 
-* Usage
+You can tweak underlying the =latexmk= command via =M-x customize-variable 
czm-tex-compile-command=.
 
-- If you run =czm-tex-compile= in a TeX buffer visiting "foo.tex", it starts 
an =eshell= buffer =*eshell-foo*= in the background that continuously compiles 
the current document.  Use =M-x customize-variable czm-tex-compile-command= to 
customize the compilation command.  If you run the same command again, then it 
switches to the =eshell= buffer.
-- =czm-tex-compile-next-error= and =czm-tex-compile-previous-error= navigate 
the error and warning messages encountered in the log file produced by 
=latexmk=, jumping to the corresponding positions in the tex buffer.
+The command =czm-tex-compile-toggle= behaves the way that I prefer -- it 
enables both =czm-tex-compile-mode= and =flymake-mode=, restricting the 
backends for the latter to those coming from the former.  Depending upon your 
preferences, you may wish to write your own "wrapper" akin to 
=czm-tex-compile-toggle= for =czm-tex-compile-mode=.
 
 That's all.  I prefer this workflow to the alternative in which one compiles 
the document manually via =TeX-command-master= (=C-c C-c=) and navigates the 
warning/error messages using =next-error= (=M-n=) and =previous-error (=M-p=).  
It also gives a handy way to keep the .aux files up-to-date; I take advantage 
of this feature in the packages 
[[https://github.com/ultronozm/czm-preview.el][czm-preview.el]] and 
[[https://github.com/ultronozm/czm-tex-fold.el][czm-tex-fold.el]] to annotate 
th [...]
diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 13535a11f5..7c2a81c1f4 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -5,7 +5,7 @@
 ;; Author: Paul D. Nelson 
 ;; Version: 0.0
 ;; URL: https://github.com/ultronozm/czm-tex-compile.el
-;; Package-Requires: ((emacs "29.1"))
+;; Package-Requires: ((emacs "29.1") (auctex))
 ;; Keywords: tex
 
 ;; This program is free software; you can redistribute it and/or modify
@@ -23,83 +23,107 @@
 
 ;;; Commentary:
 
-;; This package provides convenience functions for compiling a LaTeX
-;; document continuously via latexmk and navigating the errors and
-;; warnings recorded in the log file.  Customize the variable
-;; `czm-tex-compile-command' to change the command used to compile the
-;; document.
+;; This package provides a minor mode that compiles a LaTeX document
+;; via latexmk and reports errors and warnings to a `flymake' backend.
+;; Customize the variable `czm-tex-compile-command' to change the
+;; command used to compile the document.
 ;;
 ;; My use-package declaration:
 ;;
 ;; (use-package czm-tex-compile
-;; :vc (:url "https://github.com/ultronozm/czm-tex-compile.el.git";
-;;   :rev :newest)
-;; :after latex
-;; :bind
-;; ("C-c k" . czm-tex-compile)
-;; ("s-]" . czm-tex-compile-next-error)
-;; ("s-[" . czm-tex-compile-previous-error))
+;;   :elpaca (:host github :repo "ultronozm/czm-tex-compile.el"
+;;  :depth nil)
+;;   :bind
+;;   ("C-c k" . czm-tex-compile-toggle))
 
 ;;; Code:
 
 (require 'esh-mode)
 
+(defgroup czm-tex-compile nil
+  "Convenience functions for compiling LaTeX documents."
+  :group 'tex)
+
 (defcustom czm-tex-compile-command
   "latexmk -shell-escape -pvc -pdf -view=none -e '$pdflatex=q/pdflatex %O 
-synctex=1 -interaction=nonstopmode %S/'"
   "Command to compile L

[elpa] externals/auctex-cont-latexmk 654f3570a7 095/100: undo one change in last commit

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 654f3570a74bcea143515697ad8a9c223100fa87
Author: Paul Nelson 
Commit: Paul Nelson 

undo one change in last commit

see tex-continuous-flymake and comments
---
 tex-continuous.el | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tex-continuous.el b/tex-continuous.el
index b66c9c0596..68909216bf 100644
--- a/tex-continuous.el
+++ b/tex-continuous.el
@@ -50,6 +50,8 @@
   "Run latexmk continuously, report errors via flymake."
   :group 'tex)
 
+(defvar tex-continuous-mode)
+
 ;;; Flymake Backend
 
 (defcustom tex-continuous-report-multiple-labels t
@@ -168,7 +170,12 @@ Return a list of triples as in the docstring of
   "Flymake backend for LaTeX based on latexmk.
 Save REPORT-FN in a local variable, called by `tex-continuous--timer' to
 report diagnostics."
-  (setq tex-continuous--report-fn report-fn))
+  ;; At present, we check for `tex-continuous-mode' just to avoid
+  ;; spamming random buffers with report functions.  Could easily
+  ;; replace this with some other check if we wanted to use the
+  ;; Flymake backend provided here in other situations.
+  (when tex-continuous-mode
+(setq tex-continuous--report-fn report-fn)))
 
 (defun tex-continuous-send-report ()
   "Report to the Flymake backend."
@@ -265,8 +272,6 @@ either in a watching state or has not updated recently."
  (time-less-p (nth 5 (file-attributes file))
   (nth 5 (file-attributes log-file))
 
-(defvar tex-continuous-mode)
-
 (defvar tex-continuous--timer nil
   "Timer for reporting changes to the log file.")
 



[elpa] externals/auctex-cont-latexmk 34c8588d7e 029/100: fix some issues involving multiline warnings

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 34c8588d7e9d28bd46761918f7efdee4bde2bd12
Author: Paul Nelson 
Commit: Paul Nelson 

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



[elpa] externals/auctex-cont-latexmk b208286d55 083/100: Add some tips to README

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit b208286d5594f4a854905f21347b0105b3aca475
Author: Paul Nelson 
Commit: Paul Nelson 

Add some tips to README
---
 README.org | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/README.org b/README.org
index ffa0f6d9b0..49715fdf07 100644
--- a/README.org
+++ b/README.org
@@ -4,7 +4,7 @@
 * Overview
 This package provides a minor mode where 
[[https://ctan.org/pkg/latexmk?lang=en][latexmk]] continuously compiles the 
document in the background and the errors/warnings are reported via 
[[https://www.gnu.org/software/emacs/manual/html_node/emacs/Flymake.html][Flymake]].
 
-* Configuration
+* Configuration and usage
 Download this repository, install using =M-x package-install-file= (or 
package-vc-install, straight, elpaca, ...), and add something like the 
following to your [[https://www.emacswiki.org/emacs/InitFile][init file]]:
 #+begin_src elisp
 (use-package tex-continuous
@@ -15,7 +15,7 @@ Download this repository, install using =M-x 
package-install-file= (or package-v
 #+end_src
 Replace the keybinding with whatever you prefer (or delete it and just run the 
command via =M-x=).
 
-The command =tex-continuous-toggle= behaves the way that I prefer -- it 
enables both =tex-continuous-mode= and =flymake-mode=, restricting the backends 
for the latter to those coming from the former.  Depending upon your 
preferences, you may wish to write your own "wrapper" for =tex-continuous-mode= 
akin to =tex-continuous-toggle=.
+The command =tex-continuous-toggle= behaves the way that I prefer -- it 
enables both =tex-continuous-mode= and =flymake-mode=, restricting the backends 
for the latter to those coming from the former.  If you want to use continuous 
compilation but no flymake, then you might instead wish to bind a key to 
=tex-continuous-mode= or simply do =M-x tex-continuous-mode=.  If you already 
use flymake for something else in tex buffers, then you might wish to write 
your own "wrapper" for =tex-contin [...]
 
 The way the Flymake backend works, it will update only when the latexmk 
process reaches a "watching for changes" state and the buffer is unmodified.  
The workflow is thus to save the file, wait a few seconds for the compilation 
to complete, and then to use Flymake to navigate the errors.  I configure 
Flymake to use =M-n= and =M-p= for navigation, and also use =(setq 
flymake-show-diagnostics-at-end-of-line t)= (available in Flymake 1.3.6, part 
of Emacs 30+), which displays the error/warni [...]
 
@@ -31,12 +31,15 @@ The way the Flymake backend works, it will update only when 
the latexmk process
 
 I also bind =flymake-show-diagnostics-buffer=, which gives an overview of all 
errors.  You can find my current setup in 
[[https://github.com/ultronozm/emacsd/blob/main/init-main.el][my config]].
 
-Let me remark that TeX compilers are not so good at locating errors involving 
braces.  For this, the Emacs commands =check-parens=, =tex-validate-buffer= and 
=tex-validate-region= are indispensable.
-
 That's all.  I prefer this workflow to the alternative in which one compiles 
the document manually via =TeX-command-master= (=C-c C-c=) and navigates the 
warning/error messages using =next-error= (=M-n=) and =previous-error= (=M-p=). 
 It also gives a handy way to keep the .aux files up-to-date; I take advantage 
of this feature in the packages 
[[https://github.com/ultronozm/czm-preview.el][czm-preview.el]] and 
[[https://github.com/ultronozm/czm-tex-fold.el][czm-tex-fold.el]] to annotate t 
[...]
 
+* Tips
+- TeX compilers are not so good at locating errors involving braces.  For 
this, the Emacs commands =check-parens=, =tex-validate-buffer= and 
=tex-validate-region= are indispensable.
+
 * Customization
 - You can tweak the underlying =latexmk= command via =M-x customize-variable 
tex-continuous-command=.
+- This package respects the AUCTeX variable =TeX-output-dir=: you can use that 
variable to control where the output files generated via latexmk are placed.
 
 * Troubleshooting
 - The compilation takes place in a buffer *pvc-filename*, so look there if you 
need to see the output.
+- AUCTeX's error parsing doesn't work well with filenames (or paths) that 
contain parentheses, so don't put parentheses in your filenames.



[elpa] externals/auctex-cont-latexmk 3eeebb581f 008/100: Fix "repeat when reversing direction" nuisance

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 3eeebb581f2dbb2637875cc87057ece31109e1ff
Author: Paul Nelson 
Commit: Paul Nelson 

Fix "repeat when reversing direction" nuisance
---
 czm-tex-compile.el | 17 +
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 98b0ec0486..b13a2bacd5 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -29,7 +29,7 @@
 ;; `czm-tex-compile-command' to change the command used to compile the
 ;; document.
 ;;
-;; Sample use-package declaration:
+;; My use-package declaration:
 ;;
 ;; (use-package czm-tex-compile
 ;; :vc (:url "https://github.com/ultronozm/czm-tex-compile.el.git";
@@ -37,8 +37,8 @@
 ;; :after latex
 ;; :bind
 ;; ("C-c k" . czm-tex-compile)
-;; ("M-]" . czm-tex-compile-next-error)
-;; ("M-[" . czm-tex-compile-previous-error))
+;; ("s-]" . czm-tex-compile-next-error)
+;; ("s-[" . czm-tex-compile-previous-error))
 
 ;;; Code:
 
@@ -82,6 +82,12 @@ Used for navigating LaTeX warnings in the log file."
   (point
 (replace-regexp-in-string "\n" "" (buffer-substring-no-properties beg 
end
 
+;; TODO: look for the line .bbl in the file, and don't jump to
+;; line numbers found in log entries beyond that point (just display
+;; them).  Also, use insert-file-contents rather than
+;; find-file-noselect, etc.  Similarly, do the same for .aux files in
+;; your other packages (tex-util, preview).
+
 (defun czm-tex-compile--navigate-log-error (direction)
   "Helper function to navigate warnings in the log file.
 DIRECTION should be either \='next or \='previous."
@@ -101,6 +107,8 @@ DIRECTION should be either \='next or \='previous."
(goto-char log-pos))
   (let ((search-fn
 (if (eq direction 'previous) #'re-search-backward 
#'re-search-forward)))
+(when (eq direction 'next)
+  (forward-line 2))
(when (funcall search-fn
   (concat "^"
   (regexp-opt
@@ -126,7 +134,8 @@ DIRECTION should be either \='next or \='previous."
  (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 (if (eq direction 'previous) -1 1))
+(forward-line -1)
+   ;; (forward-line (if (eq direction 'previous) -1 1))

(setq log-pos (point))
 (unless already-open



[elpa] externals/auctex-cont-latexmk 993c2e62fe 068/100: adapt TeX-format-filter to format log more robustly

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 993c2e62fe69021b1b565fe24ec51dd1b517b155
Author: Paul Nelson 
Commit: Paul Nelson 

adapt TeX-format-filter to format log more robustly
---
 tex-continuous.el | 18 ++
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/tex-continuous.el b/tex-continuous.el
index 21ace8e2fd..8d558618cc 100644
--- a/tex-continuous.el
+++ b/tex-continuous.el
@@ -113,14 +113,24 @@ is an error rather than a warning."
(replace-regexp-in-string "\n" "" message)
region
 
+(defun tex-continuous--format-log-buffer ()
+  "Format the current log buffer by joining lines suitably.
+Adapted from `TeX-format-filter'"
+  (goto-char (point-max))
+  (while (> (point) (point-min))
+(end-of-line 0)
+(when (and (memq (- (point) (line-beginning-position)) '(79 80))
+   (not (memq (char-after (1+ (point))) '(?\n ?\()))
+   (not (and (eq (char-before) ?.)
+ (char-after (1+ (point)))
+ (not (eq ?w (char-syntax (char-after (1+ 
(point)
+  (delete-char 1
+
 (defun tex-continuous--error-list (log-file)
   "Retrieve parsed TeX error list from LOG-FILE."
   (with-temp-buffer
 (insert-file-contents log-file)
-(goto-char (point-min))
-(while (re-search-forward "Warning:" nil t)
-  (let ((fill-column most-positive-fixnum))
-(call-interactively 'fill-paragraph)))
+(tex-continuous--format-log-buffer)
 (TeX-parse-all-errors)
 TeX-error-list))
 



[elpa] externals/auctex-cont-latexmk 5c367ff46e 091/100: Replace tex-continuous--build-file with TeX-master-output-file

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 5c367ff46e716d45243424d3a9beb0cd125eef18
Author: Paul Nelson 
Commit: Paul Nelson 

Replace tex-continuous--build-file with TeX-master-output-file

also, bump required package version numbers
---
 tex-continuous.el | 23 +++
 1 file changed, 7 insertions(+), 16 deletions(-)

diff --git a/tex-continuous.el b/tex-continuous.el
index 2585d07a6e..fe0ac589dc 100644
--- a/tex-continuous.el
+++ b/tex-continuous.el
@@ -5,7 +5,7 @@
 ;; Author: Paul D. Nelson 
 ;; Version: 0.1
 ;; URL: https://github.com/ultronozm/tex-continuous.el
-;; Package-Requires: ((emacs "27.1") (auctex "11.92"))
+;; Package-Requires: ((emacs "29.3") (auctex "14.0.5"))
 ;; Keywords: tex
 
 ;; This program is free software; you can redistribute it and/or modify
@@ -83,16 +83,6 @@ file."
  " "
  (shell-quote-argument (TeX-master-file "tex")
 
-(defun tex-continuous--build-file (ext)
-  "Return the build file with extension EXT.
-Takes into account `TeX-output-dir'."
-  (if TeX-output-dir
-  (let ((master-dir (TeX-master-directory)))
-(concat (or (TeX--master-output-dir master-dir t)
-master-dir)
-(file-name-nondirectory (TeX-master-file ext
-(TeX-master-file ext)))
-
 (defun tex-continuous--get-help (message)
   "Return the AUCTeX help string for MESSAGE."
   (let ((error-alist
@@ -138,7 +128,7 @@ is an error rather than a warning."
 (search-forward search-string nil t)
 (cons (point) (1+ (point)
   (flymake-diag-region (current-buffer) (+ line offset)
- ((file-equal-p file (tex-continuous--build-file "aux"))
+ ((file-equal-p file (TeX-master-output-file "aux"))
   (and tex-continuous-report-multiple-labels
(string-match-p "multiply defined" message)
(not (eq type 'error))
@@ -190,9 +180,10 @@ Adapted from `TeX-format-filter'"
   "Process log file for current LaTeX document.
 Return a list of triples as in the docstring of
 `tex-continuous-process-item'."
-  (delq nil (mapcar (lambda (item)
-  (apply #'tex-continuous-process-item item))
-(tex-continuous--error-list (tex-continuous--build-file 
"log")
+  (delq nil
+(mapcar (lambda (item)
+  (apply #'tex-continuous-process-item item))
+(tex-continuous--error-list (TeX-master-output-file "log")
 
 (defun tex-continuous--compilation-buffer-name ()
   "Return the name of the buffer used for LaTeX compilation."
@@ -223,7 +214,7 @@ 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
 either in a watching state or has not updated recently."
   (when-let* ((file (tex-continuous--buffer-file-name))
-  (log-file (tex-continuous--build-file "log")))
+  (log-file (TeX-master-output-file "log")))
 (and
  (when-let ((buf tex-continuous--compilation-buffer))
(with-current-buffer buf



[elpa] externals/auctex-cont-latexmk 831be210d9 082/100: Deactivate upon file rename

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 831be210d9ee64d1aee478243042ff947633fe21
Author: Paul Nelson 
Commit: Paul Nelson 

Deactivate upon file rename

* tex-continuous.el (tex-continuous--compilation-buffer): New
variable, replacing function of the same name.
(tex-continuous--fresh-p, tex-continuous--unsubscribe): Use it.
(tex-continuous-mode-disable, tex-continuous-turn-on,
tex-continuous-turn-off): New functions.
(tex-continuous-mode, tex-continuous-toggle): Use them.
---
 tex-continuous.el | 68 ---
 1 file changed, 45 insertions(+), 23 deletions(-)

diff --git a/tex-continuous.el b/tex-continuous.el
index 298e2370e9..fc809324ce 100644
--- a/tex-continuous.el
+++ b/tex-continuous.el
@@ -175,9 +175,8 @@ Return a list of triples as in the docstring of
   (let ((master (abbreviate-file-name (expand-file-name (TeX-master-file)
 (format "*pvc-%s*" master)))
 
-(defun tex-continuous--compilation-buffer ()
-  "Return the buffer used for LaTeX compilation."
-  (get-buffer (tex-continuous--compilation-buffer-name)))
+(defvar-local tex-continuous--compilation-buffer nil
+  "The buffer used for LaTeX compilation.")
 
 (defconst tex-continuous--watching-str
   "=== Watching for updated files. Use ctrl/C to stop ..."
@@ -202,7 +201,7 @@ either in a watching state or has not updated recently."
   (when-let* ((file (buffer-file-name))
   (log-file (tex-continuous--build-file "log")))
 (and
- (when-let ((buf (tex-continuous--compilation-buffer)))
+ (when-let ((buf tex-continuous--compilation-buffer))
(with-current-buffer buf
  (or
   (progn
@@ -258,7 +257,7 @@ report diagnostics."
 (defun tex-continuous--unsubscribe ()
   "Unsubscribe from LaTeX compilation if the current buffer is in the list."
   (let ((buf (current-buffer))
-(comp-buf (tex-continuous--compilation-buffer))
+(comp-buf tex-continuous--compilation-buffer)
 done)
 (when comp-buf
   (with-current-buffer comp-buf
@@ -274,26 +273,34 @@ report diagnostics."
 (delete-process process))
   (kill-buffer comp-buf))
 
+(defun tex-continuous-mode-disable ()
+  "Disable `tex-continuous-mode' in all buffers."
+  (tex-continuous-mode 0))
+
 ;;;###autoload
 (define-minor-mode tex-continuous-mode
   "If enabled, run latexmk on the current tex file."
   :lighter nil
   (cond
(tex-continuous-mode
-(let ((buf (current-buffer)))
-  (if-let ((comp-buf (tex-continuous--compilation-buffer)))
+(let ((buf (current-buffer))
+  (comp-buf-name (tex-continuous--compilation-buffer-name)))
+  (if-let ((comp-buf (setq tex-continuous--compilation-buffer
+   (get-buffer comp-buf-name
   (with-current-buffer comp-buf
 (push buf tex-continuous--subscribed-buffers))
 (unless (start-process-shell-command
  "tex-continuous"
- (tex-continuous--compilation-buffer-name)
+ comp-buf-name
  (tex-continuous--compilation-command))
   (error "Failed to start LaTeX compilation"))
-(with-current-buffer (tex-continuous--compilation-buffer)
+(with-current-buffer (setq tex-continuous--compilation-buffer
+   (get-buffer comp-buf-name))
   (special-mode)
   (add-hook 'after-change-functions #'tex-continuous--update-time nil 
t)
   (push buf tex-continuous--subscribed-buffers
 (add-hook 'kill-buffer-hook 'tex-continuous--unsubscribe nil t)
+(add-hook 'after-set-visited-file-name-hook 'tex-continuous-mode-disable 
nil t)
 (when tex-continuous--timer
   (cancel-timer tex-continuous--timer)
   (setq tex-continuous--timer nil))
@@ -302,6 +309,7 @@ report diagnostics."
(t
 (tex-continuous--unsubscribe)
 (remove-hook 'kill-buffer-hook 'tex-continuous--unsubscribe t)
+(remove-hook 'after-set-visited-file-name-hook 
'tex-continuous-mode-disable t)
 (when tex-continuous--report-fn
   (setq tex-continuous--report-fn nil)
 
@@ -309,24 +317,38 @@ report diagnostics."
   "Saved value of `flymake-diagnostic-functions'.
 Saved and restored by `tex-continuous-toggle'.")
 
+(defun tex-continuous-turn-on ()
+  "Enable `tex-continuous-mode' and `flymake-mode'.
+Also set `flymake-diagnostic-functions' to `tex-continuous-flymake'."
+  (interactive)
+  (tex-continuous-mode 1)
+  (setq tex-continuous--saved-flymake-diagnostic-functions
+flymake-diagnostic-functions)
+  (setq-local flymake-diagnostic-functions '(tex-continuous-flymake))
+  (flymake-mode 1)
+  (remove-hook 'after-set-visited-file-name-hook 'tex-continuous-mode-disable 
t)
+  (add-hook 'after-set-visited-file-name-hook 'tex-continuous-turn-off nil t)
+  (message "tex-continuous-mode and flymake-mode enabled"))
+
+(defun tex-continuous-turn-off ()
+  "Disable `tex-continuous-mode' and

[elpa] externals/auctex-cont-latexmk b73ac67b86 085/100: New command tex-continuous-help-at-point

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit b73ac67b86cfd2f338d51e859d03ada6e9276f3c
Author: Paul Nelson 
Commit: Paul Nelson 

New command tex-continuous-help-at-point
---
 README.org|  1 +
 tex-continuous.el | 15 +++
 2 files changed, 16 insertions(+)

diff --git a/README.org b/README.org
index 49715fdf07..dd64c0a7a0 100644
--- a/README.org
+++ b/README.org
@@ -35,6 +35,7 @@ That's all.  I prefer this workflow to the alternative in 
which one compiles the
 
 * Tips
 - TeX compilers are not so good at locating errors involving braces.  For 
this, the Emacs commands =check-parens=, =tex-validate-buffer= and 
=tex-validate-region= are indispensable.
+- You can use the command =M-x tex-continuous-help-at-point= (or bind it to a 
key) if you want to see AUCTeX's help message (if any) for the error at point.
 
 * Customization
 - You can tweak the underlying =latexmk= command via =M-x customize-variable 
tex-continuous-command=.
diff --git a/tex-continuous.el b/tex-continuous.el
index 783b2be226..ca9707a329 100644
--- a/tex-continuous.el
+++ b/tex-continuous.el
@@ -93,6 +93,21 @@ Takes into account `TeX-output-dir'."
 (file-name-nondirectory (TeX-master-file ext
 (TeX-master-file ext)))
 
+(defun tex-continuous--get-help (message)
+  "Return the AUCTeX help string for MESSAGE."
+  (let ((error-alist
+ (append TeX-error-description-list
+ TeX-error-description-list-local)))
+(catch 'found
+  (dolist (error error-alist)
+(when (string-match (car error) message)
+  (throw 'found (cdr error)))
+
+(defun tex-continuous-help-at-point ()
+  "Display the AUCTeX help for the error at point."
+  (interactive)
+  (message "%s" (tex-continuous--get-help (help-at-pt-kbd-string
+
 (defun tex-continuous-process-item (type file line message offset _context
  search-string _line-end bad-box
  _error-point ignore)



[elpa] externals/auctex-cont-latexmk 776337f0d8 013/100: Fix the direction issue

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 776337f0d82e26ef57a1a639e6a6024a8f69d185
Author: Paul Nelson 
Commit: Paul Nelson 

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 79948cf651 066/100: tweaks, docs

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 79948cf6519f7326a6dda8724e6bcfa9388fad99
Author: Paul Nelson 
Commit: Paul Nelson 

tweaks, docs
---
 README.org|  8 ++--
 tex-continuous.el | 15 ---
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/README.org b/README.org
index 1791d77e03..c6abe8c0ed 100644
--- a/README.org
+++ b/README.org
@@ -13,8 +13,6 @@ Download this repository, install using =M-x 
package-install-file= (or package-v
 #+end_src
 Replace the keybinding with whatever you prefer (or delete it and just run the 
command via =M-x=).
 
-You can tweak the underlying =latexmk= command via =M-x customize-variable 
tex-continuous-command=.
-
 The command =tex-continuous-toggle= behaves the way that I prefer -- it 
enables both =tex-continuous-mode= and =flymake-mode=, restricting the backends 
for the latter to those coming from the former.  Depending upon your 
preferences, you may wish to write your own "wrapper" for =tex-continuous-mode= 
akin to =tex-continuous-toggle=.
 
 The way the Flymake backend works, it will update only when the latexmk 
process reaches a "watching for changes" state and the buffer is unmodified.  
The workflow is thus to save the file, wait a few seconds for the compilation 
to complete, and then to use Flymake to navigate the errors.  I configure 
Flymake to use =M-n= and =M-p= for navigation, and also use =(setq 
flymake-show-diagnostics-at-end-of-line t)=, which displays the error/warning 
messages in the buffer itself rather than jus [...]
@@ -30,3 +28,9 @@ The way the Flymake backend works, it will update only when 
the latexmk process
 #+end_src
 
 That's all.  I prefer this workflow to the alternative in which one compiles 
the document manually via =TeX-command-master= (=C-c C-c=) and navigates the 
warning/error messages using =next-error= (=M-n=) and =previous-error= (=M-p=). 
 It also gives a handy way to keep the .aux files up-to-date; I take advantage 
of this feature in the packages 
[[https://github.com/ultronozm/czm-preview.el][czm-preview.el]] and 
[[https://github.com/ultronozm/czm-tex-fold.el][czm-tex-fold.el]] to annotate t 
[...]
+
+* Customization
+- You can tweak the underlying =latexmk= command via =M-x customize-variable 
tex-continuous-command=.
+
+* Troubleshooting
+- The compilation takes place in a buffer *pvc-filename*, so look there if you 
need to see the output.
diff --git a/tex-continuous.el b/tex-continuous.el
index ce1b7cd059..62fcfe6e5f 100644
--- a/tex-continuous.el
+++ b/tex-continuous.el
@@ -32,6 +32,9 @@
 ;;
 ;; Customize the variable `tex-continuous-command' to change the
 ;; compilation command.
+;;
+;; The compilation takes place in a buffer *pvc-filename*, so look
+;; there if you need to see the output.
 
 ;;; Code:
 
@@ -44,19 +47,17 @@
 
 (defcustom tex-continuous-report-multiple-labels t
   "Non-nil means report multiple label errors via flymake."
-  :type 'boolean
-  :group 'tex-continuous)
+  :type 'boolean)
 
 (defcustom tex-continuous-command
   "latexmk -pvc -shell-escape -pdf -view=none -e '$pdflatex=q/pdflatex %O 
-synctex=1 -interaction=nonstopmode %S/'"
   "Command to compile LaTeX documents."
-  :type 'string
-  :group 'tex-continuous)
+  :type 'string)
 
 (defun tex-continuous-process-item (type file line message offset _context 
search-string
  _line-end bad-box _error-point ignore)
   "Process an error or warning for the current TeX document.
-The arguments are as in in `TeX-error-list'.  Return either nil or a
+The arguments are as in `TeX-error-list'.  Return either nil or a
 triple (ERROR-P DESCRIPTION (BEG . END)), where ERROR-P is non-nil if it
 is an error rather than a warning."
   (and
@@ -160,8 +161,8 @@ latexmk compilation is in a \"Watching\" state."
 
 (defun tex-continuous-flymake (report-fn &rest _args)
   "Flymake backend for LaTeX based on latexmk.
-Save REPORT-FN in a local variable, called by
-e`tex-continuous--timer' to report diagnostics."
+Save REPORT-FN in a local variable, called by `tex-continuous--timer' to
+report diagnostics."
   (when tex-continuous-mode
 (setq tex-continuous--report-fn report-fn)))
 



[elpa] externals/auctex-cont-latexmk 531429b321 096/100: capitalize Flymake

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 531429b321c9647ef9872ca1b1fc48de6a7520dc
Author: Paul Nelson 
Commit: Paul Nelson 

capitalize Flymake
---
 tex-continuous.el => auctex-cont-latexmk.el | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tex-continuous.el b/auctex-cont-latexmk.el
similarity index 97%
rename from tex-continuous.el
rename to auctex-cont-latexmk.el
index 68909216bf..06fe1e1373 100644
--- a/tex-continuous.el
+++ b/auctex-cont-latexmk.el
@@ -1,4 +1,4 @@
-;;; tex-continuous.el --- run latexmk continuously, report errors via flymake  
-*- lexical-binding: t; -*-
+;;; tex-continuous.el --- run latexmk continuously, report errors via Flymake  
-*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2023  Paul D. Nelson
 
@@ -27,11 +27,11 @@
 ;; via latexmk, reporting errors via `flymake'.
 ;;
 ;; Use `tex-continuous-toggle' to toggle the minor mode and set up
-;; flymake.
+;; Flymake.
 ;;
 ;; If you want to enable continuous compilation but prefer either not
-;; to use the flymake backend or to manage it yourself (e.g., in
-;; combination with other flymake backends), then instead use
+;; to use the Flymake backend or to manage it yourself (e.g., in
+;; combination with other Flymake backends), then instead use
 ;; `tex-continuous-mode' and add #'tex-continuous-flymake to
 ;; `flymake-diagnostic-functions' when you'd like.
 ;;
@@ -47,7 +47,7 @@
 (require 'flymake)
 
 (defgroup tex-continuous nil
-  "Run latexmk continuously, report errors via flymake."
+  "Run latexmk continuously, report errors via Flymake."
   :group 'tex)
 
 (defvar tex-continuous-mode)
@@ -55,7 +55,7 @@
 ;;; Flymake Backend
 
 (defcustom tex-continuous-report-multiple-labels t
-  "Non-nil means report multiple label errors via flymake."
+  "Non-nil means report multiple label errors via Flymake."
   :type 'boolean)
 
 (defun tex-continuous--get-help (message)
@@ -276,7 +276,7 @@ either in a watching state or has not updated recently."
   "Timer for reporting changes to the log file.")
 
 (defun tex-continuous--timer-function ()
-  "Report to the flymake backend if the current buffer is fresh."
+  "Report to the Flymake backend if the current buffer is fresh."
   (and tex-continuous-mode
tex-continuous--report-fn
(tex-continuous--fresh-p)



[elpa] externals/auctex-cont-latexmk b082dacb78 054/100: some good clean-up

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit b082dacb78eb8a834fefde1bc7b895d4e3c8469f
Author: Paul Nelson 
Commit: Paul Nelson 

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..98d33d 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 (

[elpa] externals/auctex-cont-latexmk ef4f329804 045/100: change description

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit ef4f32980494068fcfbc71dc0efc091019a66462
Author: Paul Nelson 
Commit: Paul Nelson 

change description
---
 README.org | 2 +-
 czm-tex-compile.el | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/README.org b/README.org
index 3af9568d0e..c8fd05aa1d 100644
--- a/README.org
+++ b/README.org
@@ -1,4 +1,4 @@
-#+title: czm-tex-compile.el: Convenience functions for compiling LaTeX
+#+title: czm-tex-compile.el: run latexmk continuously, report errors via 
flymake
 #+author: Paul Nelson
 
 * Overview
diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 8f05574685..1527c5e6d8 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -1,4 +1,4 @@
-;;; czm-tex-compile.el --- Convenience functions for compiling LaTeX  -*- 
lexical-binding: t; -*-
+;;; czm-tex-compile.el --- run latexmk continuously, report errors via flymake 
 -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2023  Paul D. Nelson
 
@@ -300,7 +300,7 @@ latexmk compilation is in a \"Watching\" state."
 (defun czm-tex-compile-flymake (report-fn &rest _args)
   "Flymake backend for LaTeX based on latexmk.
 Save REPORT-FN in a local variable, called by
-`czm-tex-compile--log-watch-timer' to report diagnostics."
+e`czm-tex-compile--log-watch-timer' to report diagnostics."
   (when (czm-tex-compile-mode)
 (setq czm-tex-compile--report-fn report-fn)))
 



[elpa] externals/auctex-cont-latexmk 4ff1de7926 004/100: fix most flycheck warnings

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 4ff1de7926393cdada6bbd1ecf92a03491e05010
Author: Paul Nelson 
Commit: Paul Nelson 

fix most flycheck warnings
---
 czm-tex-compile.el | 59 +-
 1 file changed, 36 insertions(+), 23 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index d8d73034e4..59f3b9314a 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -27,8 +27,10 @@
 
 ;;; Code:
 
+(require 'esh-mode)
+
 ;;;###autoload
-(defun czm-latexmk-this ()
+(defun czm-tex-compile-start-latexmk-eshell ()
   (interactive)
   (if (string-match "\\([^\.]+\\)\.tex" (buffer-name))
   (let ((name (match-string 1 (buffer-name
@@ -41,7 +43,9 @@
  (insert (concat "latexmk -shell-escape -pvc -pdf -view=none " 
name ".tex"))
  (eshell-send-input)))
 
-(defun my-latexmk-this ()
+;; next three are experimental
+
+(defun czm-tex-compile-my-latexmk-this-0 ()
   (interactive)
   (if (string-match "\\([^\.]+\\)\.tex" (buffer-name))
   (let ((name (match-string 1 (buffer-name)))
@@ -51,7 +55,7 @@
 (compilation-start (format "latexmk -shell-escape -pvc -pdf 
-view=none %s.tex" name) 'compilation-mode)
 (display-buffer bufname))
 
-(defun my-latexmk-this ()
+(defun czm-tex-compile-my-latexmk-this ()
   (interactive)
   (if (string-match "\\([^\.]+\\)\.tex" (buffer-name))
   (let ((name (match-string 1 (buffer-name)))
@@ -63,9 +67,9 @@
 (compilation-start (format "latexmk -shell-escape -pvc -pdf 
-view=none %s.tex" name) nil
(lambda (_mode-name) bufname))
 (display-buffer bufname)
-(local-set-key (kbd "x") 'my-kill-compilation))
+(local-set-key (kbd "x") 'czm-tex-compile-my-kill-compilation))
 
-(defun my-kill-compilation ()
+(defun czm-tex-compile-my-kill-compilation ()
   "Kill the current compilation process."
   (interactive)
   (when (get-buffer-process (current-buffer))
@@ -78,7 +82,7 @@
 ;;  (bibtex-parse-entry
 ;;   (cdr (assoc "=key=" entry))
 
-(defun my-paragraph-as-line ()
+(defun czm-tex-compile-my-paragraph-as-line ()
   (interactive)
   (let ((beg (point))
(end (save-excursion
@@ -86,19 +90,27 @@
   (point
 (replace-regexp-in-string "\n" "" (buffer-substring-no-properties beg 
end
 
-(defvar-local czm/latex-log-state nil
-  "Buffer-local variable with a cons containing last navigation time and log 
file position.")
+(defvar-local czm-tex-compile-log-state nil
+  "Cons containing last navigation time and log file position.")
+
+(defun czm-tex-compile--paragraph-as-line ()
+  (interactive)
+  (let ((beg (point))
+   (end (save-excursion
+  (forward-paragraph)
+  (point
+(replace-regexp-in-string "\n" "" (buffer-substring-no-properties beg 
end
 
-(defun czm/latex-navigate-log-error (direction)
+(defun czm-tex-compile-navigate-log-error (direction)
   "Helper function to navigate warnings in the log file.
-DIRECTION should be either 'next or 'previous."
+DIRECTION should be either \='next or \='previous."
   (let* ((tex-file (buffer-file-name))
 (log-file (concat (file-name-sans-extension tex-file) ".log"))
 (already-open (find-buffer-visiting log-file))
 (buf (or already-open (find-file-noselect log-file)))
 (file-modification-time (nth 5 (file-attributes log-file)))
-(last-navigation-time (car czm/latex-log-state))
-(log-pos (cdr czm/latex-log-state))
+(last-navigation-time (car czm-tex-compile-log-state))
+(log-pos (cdr czm-tex-compile-log-state))
 line description)
 (with-current-buffer buf
   (save-excursion)
@@ -122,7 +134,7 @@ DIRECTION should be either 'next or 'previous."
  (if error-p
  (buffer-substring-no-properties
   (point) (line-end-position))
-   (my-paragraph-as-line)))
+   (czm-tex-compile--paragraph-as-line)))
(if error-p
(progn
  (save-excursion
@@ -130,8 +142,7 @@ DIRECTION should be either 'next or 'previous."
(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
- )
+ (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 (if (eq direction 'previous) -1 1))
@@ -143,28 +154,30 @@ DIRECTION should be either 'next or 'previous."
 (when line
   (if (consp line)
  (progn
-   (goto-line (car line))
+;; TODO:

[elpa] externals/auctex-cont-latexmk 70ce392004 072/100: clarify docstring

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 70ce3920048d14bacf9fd8a7ba807385b0835b69
Author: Paul Nelson 
Commit: Paul Nelson 

clarify docstring
---
 tex-continuous.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tex-continuous.el b/tex-continuous.el
index 85b247e918..a72e248541 100644
--- a/tex-continuous.el
+++ b/tex-continuous.el
@@ -280,7 +280,8 @@ report diagnostics."
   (setq tex-continuous--report-fn nil)
 
 (defvar-local tex-continuous--saved-flymake-diagnostic-functions nil
-  "Value of `flymake-diagnostic-functions' before calling 
`tex-continuous-toggle'.")
+  "Saved value of `flymake-diagnostic-functions'.
+Saved and restored by `tex-continuous-toggle'.")
 
 ;;;###autoload
 (defun tex-continuous-toggle ()



[elpa] externals/auctex-cont-latexmk ad6dc99345 033/100: fix flycheck warnings

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit ad6dc99345bde7a0f38932ae81549c14231760cd
Author: Paul Nelson 
Commit: Paul Nelson 

fix flycheck warnings
---
 czm-tex-compile.el | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 31aa39f14b..13535a11f5 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -97,15 +97,15 @@ Used for navigating LaTeX warnings in the log file."
  (point
 (replace-regexp-in-string "\n" "" (buffer-substring-no-properties beg 
end
 
+
+(require 'tex)
+
 (defun czm-tex-compile-process-log ()
   "Process the log file for the current LaTeX document."
   (let* ((current-buf (current-buffer))
  (tex-file (buffer-file-name))
(log-file (concat (file-name-sans-extension tex-file)
-   ".log"))
- (error-prefix "! ")
- (warning-prefix "LaTeX Warning: ")
-   results)
+   ".log")))
 (with-temp-buffer
   (insert-file-contents log-file)
   (let* ((error-list (progn (TeX-parse-all-errors)
@@ -128,8 +128,7 @@ Used for navigating LaTeX warnings in the log file."
 ;; (progn 
(string-match " Warning: " description-raw)
 ;;(match-end 
0))
 -1)))
-  line prefix
-  region)
+  line prefix)
  (if error-p
  (with-temp-buffer
(insert (nth 5 item))
@@ -200,8 +199,7 @@ the log file is newer than the current buffer."
   description)))
  (seq-filter
   (lambda (datum)
-(not (null (nth 2 datum)))
-)
+(not (null (nth 2 datum
   log-data
 (funcall report-fn diags)
 t))
@@ -256,10 +254,12 @@ ARGS are the keyword-value pairs concerning edits"
 nil t))
 
 (defun czm-tex-compile-restrict-flymake-backends ()
+  "Restrict flymake backends to `czm-tex-compile-flymake'."
   (interactive)
   (setq flymake-diagnostic-functions '(czm-tex-compile-flymake t)))
 
 (defun czm-tex-compile-relax-flymake-backends ()
+  "Relax flymake backends to include `LaTeX-flymake'."
   (interactive)
   (setq flymake-diagnostic-functions '(czm-tex-compile-flymake LaTeX-flymake 
t)))
 



[elpa] externals/auctex-cont-latexmk 973154d7d5 060/100: more tweaks

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 973154d7d5542d6a70dc7146438c66373b3a0890
Author: Paul Nelson 
Commit: Paul Nelson 

more tweaks
---
 czm-tex-compile.el | 40 
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 7a5e353ecd..86cd1ae768 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -174,7 +174,6 @@ cell (BEG . END) indicating where the error happens."
   "Return the command used to compile the current LaTeX document."
   (format "%s %s" czm-tex-compile-command (TeX-master-file "tex")))
 
-
 (defun czm-tex-compile--compilation-buffer-name ()
   "Return the name of the buffer used for LaTeX compilation."
   (let ((master (abbreviate-file-name (expand-file-name (TeX-master-file)
@@ -208,9 +207,6 @@ latexmk compilation is in a \"Watching\" state."
 (defun czm-tex-compile--timer-function ()
   "Report to the flymake backend if the current buffer is fresh."
   (when czm-tex-compile--timer-enabled
-(dolist (datum (czm-tex-compile-process-log))
-  (cl-assert (not (null (nth 2 datum))) nil
- "Region is nil in datum: %S" datum))
 (when (and czm-tex-compile--report-fn (czm-tex-compile--fresh-p))
   (funcall
czm-tex-compile--report-fn
@@ -235,6 +231,25 @@ e`czm-tex-compile--timer' to report diagnostics."
 (defvar-local czm-tex-compile--subscribed-buffers nil
   "List of buffers subscribed to the current LaTeX compilation.")
 
+(defun czm-tex-compile--unsubscribe ()
+  "Unsubscribe from LaTeX compilation if the current buffer is in the list."
+  (let ((buf (current-buffer))
+(comp-buf (czm-tex-compile--compilation-buffer))
+done)
+(with-current-buffer comp-buf
+  (setq czm-tex-compile--subscribed-buffers
+(cl-remove buf czm-tex-compile--subscribed-buffers))
+  (when (null czm-tex-compile--subscribed-buffers)
+(setq done t)))
+(when done
+  (let ((process (get-buffer-process comp-buf)))
+(when (process-live-p process)
+  (interrupt-process process)
+  (sit-for 0.1)
+  (delete-process process))
+(kill-buffer comp-buf)))
+(setq czm-tex-compile--timer-enabled nil)))
+
 ;;;###autoload
 (define-minor-mode czm-tex-compile-mode
   "If enabled, run LaTeX compilation on the current buffer."
@@ -262,22 +277,7 @@ e`czm-tex-compile--timer' to report diagnostics."
   (run-with-timer 2 1 #'czm-tex-compile--timer-function))
 (setq czm-tex-compile--timer-enabled t))
(t
-(let ((buf (current-buffer))
-  (comp-buf (czm-tex-compile--compilation-buffer))
-  done)
-  (with-current-buffer comp-buf
-(setq czm-tex-compile--subscribed-buffers
-  (cl-remove buf czm-tex-compile--subscribed-buffers))
-(when (null czm-tex-compile--subscribed-buffers)
-  (setq done t)))
-  (when done
-(let ((process (get-buffer-process comp-buf)))
-  (when (process-live-p process)
-(interrupt-process process)
-(sit-for 0.1)
-(delete-process process))
-  (kill-buffer comp-buf)))
-  (setq czm-tex-compile--timer-enabled nil))
+(czm-tex-compile--unsubscribe)
 (when czm-tex-compile--report-fn
   (setq czm-tex-compile--report-fn nil)
 



[elpa] externals/auctex-cont-latexmk 61cf12f244 032/100: for errors, just get line number directly

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 61cf12f244693e6688331369c96e534a90454262
Author: Paul Nelson 
Commit: Paul Nelson 

for errors, just get line number directly
---
 czm-tex-compile.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index a58ab1eab3..31aa39f14b 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -134,9 +134,8 @@ Used for navigating LaTeX warnings in the log file."
  (with-temp-buffer
(insert (nth 5 item))
(goto-char (point-min))
-   (when (re-search-forward "^\nl\\.\\([0-9]+\\) " 
nil t)
- (setq line (when (match-string 1)
-  (string-to-number (match-string 
1
+   (setq line (nth 2 item))
+   (when (re-search-forward "\nl\\.\\([0-9]+\\) " 
nil t)
   (setq prefix 
(buffer-substring-no-properties (point)
   
(line-end-position)
  (when (string-match "input line \\([0-9]+\\)" 
description)



[elpa] externals/auctex-label-numbers 235bc005b2 01/12: Initial commit

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-label-numbers
commit 235bc005b242a2e76e38060a8e8f2cf339ad4a90
Author: Paul Nelson <63298781+ultron...@users.noreply.github.com>
Commit: GitHub 

Initial commit
---
 .gitignore | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00..206569dc66
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,11 @@
+# Compiled
+*.elc
+
+# Packaging
+.cask
+
+# Backup files
+*~
+
+# Undo-tree save-files
+*.~undo-tree



[elpa] externals/auctex-cont-latexmk 6d80a69168 078/100: Clarify docstring

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 6d80a691684b2ad41cc355282f2a49a6bbd40bdb
Author: Paul Nelson 
Commit: Paul Nelson 

Clarify docstring

* tex-continuous.el (tex-continuous-mode):
---
 tex-continuous.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tex-continuous.el b/tex-continuous.el
index 6f1bfa2879..20d0e52629 100644
--- a/tex-continuous.el
+++ b/tex-continuous.el
@@ -276,7 +276,7 @@ report diagnostics."
 
 ;;;###autoload
 (define-minor-mode tex-continuous-mode
-  "If enabled, run LaTeX compilation on the current buffer."
+  "If enabled, run latexmk on the current tex file."
   :lighter nil
   (cond
(tex-continuous-mode



[elpa] externals/auctex-cont-latexmk f30652de43 099/100: Preserve Flymake status and selected Flymake backends

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit f30652de43477d79fe27b17231fc3ab491251b45
Author: Paul Nelson 
Commit: Paul Nelson 

Preserve Flymake status and selected Flymake backends

This is achieved via the new local variable
tex-continuous--saved-flymake-mode and customization option
tex-continuous-retained-flymake-backends.
---
 auctex-cont-latexmk.el | 36 +---
 1 file changed, 25 insertions(+), 11 deletions(-)

diff --git a/auctex-cont-latexmk.el b/auctex-cont-latexmk.el
index f9250cc8a2..bb7a557465 100644
--- a/auctex-cont-latexmk.el
+++ b/auctex-cont-latexmk.el
@@ -383,33 +383,47 @@ This is called from the compilation buffer when it is 
killed."
   "Saved value of `flymake-diagnostic-functions'.
 Saved and restored by `tex-continuous-toggle'.")
 
+(defvar-local tex-continuous--saved-flymake-mode nil
+  "Saved value of `flymake-mode'.
+Saved and restored by `tex-continuous-toggle'.")
+
+(defcustom tex-continuous-retained-flymake-backends
+  '(eglot-flymake-backend)
+  "Flymake backends to retain when enabling `tex-continuous-mode'."
+  :type 'boolean)
+
 (defun tex-continuous-turn-on ()
-  "Enable `tex-continuous-mode' and `flymake-mode'.
-Also set `flymake-diagnostic-functions' to `tex-continuous-flymake'."
+  "Enable `tex-continuous-mode' and set up Flymake."
   (interactive)
   (tex-continuous-mode 1)
   (setq tex-continuous--saved-flymake-diagnostic-functions
 flymake-diagnostic-functions)
-  (setq-local flymake-diagnostic-functions '(tex-continuous-flymake))
+  (setq tex-continuous--saved-flymake-mode (if flymake-mode 1 0))
+  (setq-local flymake-diagnostic-functions
+  (append
+   '(tex-continuous-flymake)
+   (seq-intersection flymake-diagnostic-functions
+ tex-continuous-retained-flymake-backends)))
   (flymake-mode 1)
   (setq tex-continuous--disable-function 'tex-continuous-turn-off)
-  (add-hook 'clone-indirect-buffer-hook 
#'tex-continuous--clone-indirect-buffer-hook nil t)
-  (message "tex-continuous-mode and flymake-mode enabled"))
+  (add-hook 'clone-indirect-buffer-hook
+#'tex-continuous--clone-indirect-buffer-hook nil t)
+  (message "tex-continuous-mode enabled"))
 
 (defun tex-continuous-turn-off ()
-  "Disable `tex-continuous-mode' and `flymake-mode'.
-Also restore `flymake-diagnostic-functions'."
+  "Disable `tex-continuous-mode' and restore flymake settings."
   (interactive)
   (tex-continuous-mode 0)
-  (flymake-mode 0)
-  (remove-hook 'clone-indirect-buffer-hook 
#'tex-continuous--clone-indirect-buffer-hook t)
+  (flymake-mode tex-continuous--saved-flymake-mode)
+  (remove-hook 'clone-indirect-buffer-hook
+   #'tex-continuous--clone-indirect-buffer-hook t)
   (setq-local flymake-diagnostic-functions
   tex-continuous--saved-flymake-diagnostic-functions)
-  (message "tex-continuous-mode and flymake-mode disabled"))
+  (message "tex-continuous-mode disabled"))
 
 ;;;###autoload
 (defun tex-continuous-toggle ()
-  "Toggle `tex-continuous-mode', and also `flymake-mode'."
+  "Toggle `tex-continuous-mode' and its Flymake backend."
   (interactive)
   (cond (tex-continuous-mode
  (tex-continuous-turn-off))



[elpa] externals/auctex-cont-latexmk de469de0a1 051/100: remove hbox from the list of ignored warnings

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit de469de0a11603612a774777bd2eb8acc5a51107
Author: Paul Nelson 
Commit: Paul Nelson 

remove hbox from the list of ignored warnings

These are treated specially by auctex, anyway
---
 czm-tex-compile.el | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 9670fcdbc2..051f335be4 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -81,8 +81,7 @@ Also kill the timer for watching the log file."
   "String indicating that latexmk is watching for updated files.")
 
 (defcustom czm-tex-compile-ignored-warnings
-  '("Package hyperref Warning: Token not allowed in a PDF string"
-"Overfull \\hbox" "Underfull \\hbox")
+  '("Package hyperref Warning: Token not allowed in a PDF string")
   "List of warnings to ignore when parsing LaTeX log files."
   :type '(repeat string))
 



[elpa] externals/auctex-label-numbers 18a001df85 03/12: fix URL

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-label-numbers
commit 18a001df852453ba2814e5a1900672873bac9365
Author: Paul Nelson 
Commit: Paul Nelson 

fix URL
---
 tex-numbers.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tex-numbers.el b/tex-numbers.el
index 4eea0dcfa9..119393c67b 100644
--- a/tex-numbers.el
+++ b/tex-numbers.el
@@ -4,7 +4,7 @@
 
 ;; Author: Paul D. Nelson 
 ;; Version: 0.0
-;; URL: https://github.com/ultronozm/czm-preview.el
+;; URL: https://github.com/ultronozm/tex-numbers.el
 ;; Package-Requires: ((emacs "26.1") (auctex))
 ;; Keywords: tex
 



[elpa] externals/auctex-cont-latexmk b34fcf062a 098/100: add local variable tex-continuous-force-enable

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit b34fcf062a11e1ab6dd6315b4fb405d7324fd088
Author: Paul Nelson 
Commit: Paul Nelson 

add local variable tex-continuous-force-enable

This can be used to test the Flymake backend in other contexts.
---
 auctex-cont-latexmk.el | 18 ++
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/auctex-cont-latexmk.el b/auctex-cont-latexmk.el
index ee633e14e6..f9250cc8a2 100644
--- a/auctex-cont-latexmk.el
+++ b/auctex-cont-latexmk.el
@@ -163,9 +163,12 @@ Return a list of triples as in the docstring of
 (defvar-local tex-continuous--report-fn nil
   "Function provided by Flymake for reporting diagnostics.")
 
-(defun tex-continuous--clone-indirect-buffer-hook ()
-  "Set `tex-continuous--report-fn' to nil after cloning an indirect buffer."
-  (setq tex-continuous--report-fn nil))
+(defvar-local tex-continuous-force-enable nil
+  "Whether to enable the Flymake backend unconditionally.
+This is non-nil if we should enable the Flymake backend independent of
+whether `tex-continuous-mode' is enabled.  This may be useful for
+testing or applying the backend in other contexts, e.g., in the context
+of AUCTeX's built-in compilation functions.")
 
 (defun tex-continuous-flymake (report-fn &rest _args)
   "Flymake backend for LaTeX based on latexmk.
@@ -175,7 +178,7 @@ report diagnostics."
   ;; spamming random buffers with report functions.  Could easily
   ;; replace this with some other check if we wanted to use the
   ;; Flymake backend provided here in other situations.
-  (when tex-continuous-mode
+  (when (or tex-continuous-mode tex-continuous-force-enable)
 (setq tex-continuous--report-fn report-fn)))
 
 (defun tex-continuous-send-report ()
@@ -191,6 +194,13 @@ report diagnostics."
  description)))
 (tex-continuous-process-log
 
+(defun tex-continuous--clone-indirect-buffer-hook ()
+  "Set `tex-continuous--report-fn' to nil after cloning an indirect buffer.
+This should be added to `clone-indirect-buffer-hook' for any buffer in
+which the Flymake backend is used.  This is because we don't want the
+Flymake report function to propagate to indirect buffers."
+  (setq tex-continuous--report-fn nil))
+
 ;;; Continuous Compilation
 
 (defcustom tex-continuous-command



[elpa] externals/auctex-cont-latexmk 2986f5ce44 057/100: got to working OK w/ multifile projects

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 2986f5ce44afd19c4440cf8127e9c88fd70f904f
Author: Paul Nelson 
Commit: Paul Nelson 

got to working OK w/ multifile projects
---
 czm-tex-compile.el | 212 -
 1 file changed, 112 insertions(+), 100 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 2f077db3c0..39417c8cf2 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -51,30 +51,16 @@
   :type 'string
   :group 'czm-tex-compile)
 
-(defvar-local czm-tex-compile--process nil
-  "Process running the LaTeX compilation.")
-
 (defvar-local czm-tex-compile--report-fn nil
   "Function provided by Flymake for reporting diagnostics.")
 
-(defvar-local czm-tex-compile--timer nil
+(defvar-local czm-tex-compile--timer-enabled nil)
+
+(defvar czm-tex-compile--timer nil
   "Timer for reporting changes to the log file.")
 
-(defvar-local czm-tex-compile--compilation-buffer-name nil
-  "Name of the buffer used for LaTeX compilation.")
-
-(defun czm-tex-compile--kill-process ()
-  "Kill the LaTeX compilation process associated with the buffer.
-Also kill the timer for watching the log file."
-  (when (process-live-p czm-tex-compile--process)
-(interrupt-process czm-tex-compile--process)
-(sit-for 0.1)
-(delete-process czm-tex-compile--process))
-  (when (get-buffer czm-tex-compile--compilation-buffer-name)
-(kill-buffer czm-tex-compile--compilation-buffer-name))
-  (when czm-tex-compile--timer
-(cancel-timer czm-tex-compile--timer)
-(setq czm-tex-compile--timer nil)))
+;; (defvar-local czm-tex-compile--compilation-buffer-name nil
+;;   "Name of the buffer used for LaTeX compilation.")
 
 (defconst czm-tex-compile--watching-str
   "=== Watching for updated files. Use ctrl/C to stop ..."
@@ -150,39 +136,57 @@ 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."
-  (mapcar
-   (lambda (item)
- (let ((error-p (eq (nth 0 item) 'error))
-   (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 (not is-bad-box)
-czm-tex-compile-report-hbox-errors)
-(if error-p
-(czm-tex-compile--process-regular-error context line)
-  (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 error-p)
-(czm-tex-compile--process-multiply-defined-warning 
message))
- (list error-p
-   (replace-regexp-in-string "\n" "" message)
-   region
-   (czm-tex-compile--error-list (TeX-master-file "log"
+  (let* ((error-list (czm-tex-compile--error-list (TeX-master-file "log")))
+ (processed-list
+  (mapcar
+   (lambda (item)
+ (let ((error-p (eq (nth 0 item) 'error))
+   (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 (not is-bad-box)
+czm-tex-compile-report-hbox-errors)
+(if error-p
+(czm-tex-compile--process-regular-error context 
line)
+  (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 error-p)
+(czm-tex-compile--pro

[elpa] externals/auctex-cont-latexmk 5e9df47daf 086/100: Put errors without file or line number at end of buffer

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 5e9df47dafa3e47b6cab1d01947dbd58935235db
Author: Paul Nelson 
Commit: Paul Nelson 

Put errors without file or line number at end of buffer
---
 tex-continuous.el | 80 ++-
 1 file changed, 43 insertions(+), 37 deletions(-)

diff --git a/tex-continuous.el b/tex-continuous.el
index ca9707a329..9745ff3d43 100644
--- a/tex-continuous.el
+++ b/tex-continuous.el
@@ -115,46 +115,52 @@ Takes into account `TeX-output-dir'."
 The arguments are as in `TeX-error-list'.  Return either nil or a
 triple (ERROR-P DESCRIPTION (BEG . END)), where ERROR-P is non-nil if it
 is an error rather than a warning."
-  (and
-   (not ignore)
-   (stringp file)
-   (or (not bad-box) TeX-debug-bad-boxes)
-   (when-let
-   ((region
- (save-restriction
-   (widen)
-   (cond
-((file-equal-p file (buffer-file-name))
- (when line
-   (if (eq type 'error)
-   (save-excursion
- (goto-char (point-min))
- (forward-line (+ line offset -1))
- (unless (string= search-string " ")
-   (search-forward search-string nil t)
-   (cons (point) (1+ (point)
- (flymake-diag-region (current-buffer) (+ line offset)
-((file-equal-p file (tex-continuous--build-file "aux"))
- (and tex-continuous-report-multiple-labels
-  (string-match-p "multiply defined" message)
-  (not (eq type 'error))
-  (let* ((label (progn
-  (string-match "`\\(.*\\)'" message)
-  (match-string 1 message)))
- (label-re
-  (concat "label\\(?:\\[[^]]+\\]\\)?{"
-  (regexp-quote label) "}")))
+  (or
+   (and
+(not ignore)
+(stringp file)
+(or (not bad-box) TeX-debug-bad-boxes)
+(when-let
+((region
+  (save-restriction
+(widen)
+(cond
+ ((file-equal-p file (buffer-file-name))
+  (when line
+(if (eq type 'error)
 (save-excursion
   (goto-char (point-min))
-  (when (re-search-forward label-re nil t)
-;; Return the full line so the diagnostic is
-;; not covered by preview overlays when
-;; \\label appears after \\begin{equation}.
-(cons (line-beginning-position)
-  (line-end-position)))
- (list (eq type 'error)
+  (forward-line (+ line offset -1))
+  (unless (string= search-string " ")
+(search-forward search-string nil t)
+(cons (point) (1+ (point)
+  (flymake-diag-region (current-buffer) (+ line offset)
+ ((file-equal-p file (tex-continuous--build-file "aux"))
+  (and tex-continuous-report-multiple-labels
+   (string-match-p "multiply defined" message)
+   (not (eq type 'error))
+   (let* ((label (progn
+   (string-match "`\\(.*\\)'" message)
+   (match-string 1 message)))
+  (label-re
+   (concat "label\\(?:\\[[^]]+\\]\\)?{"
+   (regexp-quote label) "}")))
+ (save-excursion
+   (goto-char (point-min))
+   (when (re-search-forward label-re nil t)
+ ;; Return the full line so the diagnostic is
+ ;; not covered by preview overlays when
+ ;; \\label appears after \\begin{equation}.
+ (cons (line-beginning-position)
+   (line-end-position)))
+  (list (eq type 'error)
+(replace-regexp-in-string "\n" "" message)
+region)))
+   ;; Put errors without file or line at bottom of buffer.
+   (when (eq type 'error)
+ (list t
(replace-regexp-in-string "\n" "" message)
-   region
+   (cons (1- (point-max)) (point-max))
 
 (defun tex-continuous--format-log-buffer ()
   "Format the current log buffer by joining lines suitably.



[elpa] externals/auctex-cont-latexmk c2069da6b9 035/100: reduce "sit-for" time

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit c2069da6b9e5534a3e4eb2d3f2abdfdfd1a7d395
Author: Paul Nelson 
Commit: Paul Nelson 

reduce "sit-for" time
---
 czm-tex-compile.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 7c2a81c1f4..72d6db3a0a 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -68,7 +68,7 @@
   (user-error "Buffer name does not match expected pattern"))
 (when (process-live-p czm-tex-compile-process)
   (interrupt-process czm-tex-compile-process)
-  (sit-for 1)
+  (sit-for 0.1)
   (delete-process czm-tex-compile-process))
 (setq czm-tex-compile--compilation-buffer-name (concat 
"*czm-tex-compile-" name "*"))
 (let ((command (concat czm-tex-compile-command " " name ".tex")))
@@ -107,7 +107,7 @@
   "Kill the LaTeX compilation process associated with the buffer."
   (when (process-live-p czm-tex-compile-process)
 (interrupt-process czm-tex-compile-process)
-(sit-for 1)
+(sit-for 0.1)
 (delete-process czm-tex-compile-process))
   (when (get-buffer czm-tex-compile--compilation-buffer-name)
 (kill-buffer czm-tex-compile--compilation-buffer-name)))



[elpa] externals/auctex-cont-latexmk b3ec5c29d4 058/100: flycheck errors

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit b3ec5c29d42916d8aadcde66e18982057bafc612
Author: Paul Nelson 
Commit: Paul Nelson 

flycheck errors
---
 czm-tex-compile.el | 10 +++---
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 39417c8cf2..281b2573cd 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -59,9 +59,6 @@
 (defvar czm-tex-compile--timer nil
   "Timer for reporting changes to the log file.")
 
-;; (defvar-local czm-tex-compile--compilation-buffer-name nil
-;;   "Name of the buffer used for LaTeX compilation.")
-
 (defconst czm-tex-compile--watching-str
   "=== Watching for updated files. Use ctrl/C to stop ..."
   "String indicating that latexmk is watching for updated files.")
@@ -82,7 +79,7 @@
   :group 'czm-tex-compile)
 
 (defun czm-tex-compile--process-multiply-defined-warning (message)
-  "Get position of multiply defined MESSAGE labels in BUF."
+  "Get position of multiply defined MESSAGE labels."
   (let ((label (progn
  (string-match "`\\(.*\\)'" message)
  (match-string 1 message
@@ -170,8 +167,7 @@ cell (BEG . END) indicating where the error happens."
  (list error-p
(replace-regexp-in-string "\n" "" message)
region
-   error-list
-   )))
+   error-list)))
 (delq nil processed-list)))
 
 (defun czm-tex-compile--compilation-command ()
@@ -199,7 +195,7 @@ latexmk compilation is in a \"Watching\" state."
 (and
  (when-let ((buf (czm-tex-compile--compilation-buffer)))
(with-current-buffer buf
- (goto-char (point-max)) 
+ (goto-char (point-max))
  (forward-line -1)
  (equal (buffer-substring (point) (line-end-position))
 czm-tex-compile--watching-str)))



[elpa] externals/auctex-cont-latexmk 6cbd9d1493 067/100: respect TeX-output-dir

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 6cbd9d149308a5008e0f57b56690416fe59aa80d
Author: Paul Nelson 
Commit: Paul Nelson 

respect TeX-output-dir
---
 tex-continuous.el | 27 ++-
 1 file changed, 22 insertions(+), 5 deletions(-)

diff --git a/tex-continuous.el b/tex-continuous.el
index 62fcfe6e5f..21ace8e2fd 100644
--- a/tex-continuous.el
+++ b/tex-continuous.el
@@ -51,9 +51,21 @@
 
 (defcustom tex-continuous-command
   "latexmk -pvc -shell-escape -pdf -view=none -e '$pdflatex=q/pdflatex %O 
-synctex=1 -interaction=nonstopmode %S/'"
-  "Command to compile LaTeX documents."
+  "Command to compile LaTeX documents.
+This is combined with an additional option to output build files to a
+directory, if `TeX-output-dir' is set, and the name of the master file."
   :type 'string)
 
+(defun tex-continuous--build-file (ext)
+  "Return the build file with extension EXT.
+Takes into account `TeX-output-dir'."
+  (if TeX-output-dir
+  (let ((master-dir (TeX-master-directory)))
+(concat (or (TeX--master-output-dir master-dir t)
+master-dir)
+(file-name-nondirectory (TeX-master-file ext
+(TeX-master-file ext)))
+
 (defun tex-continuous-process-item (type file line message offset _context 
search-string
  _line-end bad-box _error-point ignore)
   "Process an error or warning for the current TeX document.
@@ -79,7 +91,7 @@ is an error rather than a warning."
(search-forward search-string nil t)
(cons (point) (1+ (point)
  (flymake-diag-region (current-buffer) (+ line offset)
-((file-equal-p file (TeX-master-file "aux"))
+((file-equal-p file (tex-continuous--build-file "aux"))
  (and tex-continuous-report-multiple-labels
   (string-match-p "multiply defined" message)
   (not (eq type 'error))
@@ -118,7 +130,7 @@ Return a list of triples as in the docstring of
 `tex-continuous-process-item'."
   (delq nil (mapcar (lambda (item)
   (apply #'tex-continuous-process-item item))
-(tex-continuous--error-list (TeX-master-file "log")
+(tex-continuous--error-list (tex-continuous--build-file 
"log")
 
 (defun tex-continuous--compilation-buffer-name ()
   "Return the name of the buffer used for LaTeX compilation."
@@ -140,7 +152,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 (TeX-master-file "log")))
+  (log-file (tex-continuous--build-file "log")))
 (and
  (when-let ((buf (tex-continuous--compilation-buffer)))
(with-current-buffer buf
@@ -209,7 +221,12 @@ report diagnostics."
 
 (defun tex-continuous--compilation-command ()
   "Return the command used to compile the current LaTeX document."
-  (format "%s %s" tex-continuous-command (TeX-master-file "tex")))
+  (concat
+   tex-continuous-command
+   (when TeX-output-dir
+ (format " -outdir='%s'" TeX-output-dir))
+   " "
+   (TeX-master-file "tex")))
 
 ;;;###autoload
 (define-minor-mode tex-continuous-mode



[elpa] externals/auctex-cont-latexmk 8ed7904de5 055/100: maybe did ok

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit 8ed7904de5a91b6694137c771265077ea74cea01
Author: Paul Nelson 
Commit: Paul Nelson 

maybe did ok
---
 czm-tex-compile.el | 75 +-
 1 file changed, 29 insertions(+), 46 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 98d33d..3d9886d374 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -95,51 +95,43 @@ Also kill the timer for watching the log file."
   :type 'boolean
   :group 'czm-tex-compile)
 
-(defun czm-tex-compile--process-multiply-defined-warning (message buf)
+(defun czm-tex-compile--process-multiply-defined-warning (message)
   "Get position of multiply defined MESSAGE labels in BUF."
   (let ((label (progn
  (string-match "`\\(.*\\)'" message)
  (match-string 1 message
-(with-current-buffer buf
-  (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
-
-(defun czm-tex-compile--process-regular-error (context line current-buf)
-  "Get position of error and handle CONTEXT and LINE in CURRENT-BUF.
+(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)))
+
+(defun czm-tex-compile--process-regular-error (context line)
+  "Get position of error and handle CONTEXT and LINE.
 Return a cons cell (BEG . END) indicating where the error happens, or
 nil if the error is not found."
-  (let ((prefix nil))
-(with-temp-buffer
-  (insert context)
-  (goto-char (point-min))
-  (when (re-search-forward "\nl\\.\\([0-9]+\\) " nil t)
-(setq prefix (buffer-substring-no-properties (point)
- (line-end-position)
-(when prefix
-  (let ((pos
- (with-current-buffer current-buf
+  (when-let* ((prefix (with-temp-buffer
+(insert context)
+(goto-char (point-min))
+(when (re-search-forward "\nl\\.\\([0-9]+\\) " nil t)
+  (buffer-substring-no-properties
+   (point) (line-end-position)
+  (pos
(save-excursion
  (save-restriction
(widen)
(goto-char (point-min))
(forward-line (1- line))
(let ((truncated-prefix
-  (substring prefix
- (max 0 (- (length prefix)
-   3
+  (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)))
+ (or (search-forward truncated-prefix line-end t)
+ bol))
+(cons pos (1+ pos
 
 (defun czm-tex-compile--error-list (log-file)
   "Retrieve parsed TeX error list from LOG-FILE."
@@ -160,7 +152,7 @@ warning, DESCRIPTION is what you'd expect, and REGION is a 
cons
 cell (BEG . END) indicating where the error happens."
   (mapcar
(lambda (item)
- (let ((type (nth 0 item))
+ (let ((error-p (eq (nth 0 item) 'error))
(file (nth 1 item))
(line (nth 2 item))
(message (nth 3 item))
@@ -179,24 +171,15 @@ cell (BEG . END) indicating where the error happens."
 (stringp file)
 (or (not is-bad-box)
 czm-tex-compile-report-hbox-errors)
-(if (eq type 'error)
-(czm-tex-compile--process-regular-error context line 
(current-buffer))
+(if error-p
+(czm-tex-compile--process-regular-error context line)
   (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))
-  (wh

[elpa] externals/auctex-cont-latexmk c1a53a8e76 064/100: tidy

2024-06-06 Thread ELPA Syncer
branch: externals/auctex-cont-latexmk
commit c1a53a8e768122bfa3e0816911f5d0a71d46e28f
Author: Paul Nelson 
Commit: Paul Nelson 

tidy
---
 czm-tex-compile.el | 192 ++---
 1 file changed, 96 insertions(+), 96 deletions(-)

diff --git a/czm-tex-compile.el b/czm-tex-compile.el
index 6858c5f3a1..84a27790ae 100644
--- a/czm-tex-compile.el
+++ b/czm-tex-compile.el
@@ -1,11 +1,11 @@
-;;; czm-tex-compile.el --- run latexmk continuously, report errors via flymake 
 -*- lexical-binding: t; -*-
+;;; tex-continuous.el --- run latexmk continuously, report errors via flymake  
-*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2023  Paul D. Nelson
 
 ;; Author: Paul D. Nelson 
 ;; Version: 0.1
-;; URL: https://github.com/ultronozm/czm-tex-compile.el
-;; Package-Requires: ((emacs "29.1") (auctex))
+;; URL: https://github.com/ultronozm/tex-continuous.el
+;; Package-Requires: ((emacs "27.1") (auctex "11.92"))
 ;; Keywords: tex
 
 ;; This program is free software; you can redistribute it and/or modify
@@ -25,38 +25,43 @@
 
 ;; This package provides a minor mode that compiles a LaTeX document
 ;; via latexmk, reporting errors via `flymake'.  Customize the
-;; variable `czm-tex-compile-command' to change the command used to
+;; variable `tex-continuous-command' to change the command used to
 ;; compile the document.
 ;;
 ;; My use-package declaration:
 ;;
-;; (use-package czm-tex-compile
-;;   :elpaca (:host github :repo "ultronozm/czm-tex-compile.el"
+;; (use-package tex-continuous
+;;   :elpaca (:host github :repo "ultronozm/tex-continuous.el"
 ;;  :depth nil)
 ;;   :bind
-;;   ("C-c k" . czm-tex-compile-toggle))
+;;   ("C-c k" . tex-continuous-toggle))
 
 ;;; Code:
 
 (require 'tex)
 (require 'flymake)
 
-(defgroup czm-tex-compile nil
+(defgroup tex-continuous nil
   "Run latexmk continuously, report errors via flymake."
   :group 'tex)
 
-(defcustom czm-tex-compile-report-multiple-labels t
+(defcustom tex-continuous-report-multiple-labels t
   "Non-nil means report multiple label errors via flymake."
   :type 'boolean
-  :group 'czm-tex-compile)
+  :group 'tex-continuous)
 
-(defun czm-tex-compile-process-item (type file line message offset _context 
search-string
+(defcustom tex-continuous-command
+  "latexmk -pvc -shell-escape -pdf -view=none -e '$pdflatex=q/pdflatex %O 
-synctex=1 -interaction=nonstopmode %S/'"
+  "Command to compile LaTeX documents."
+  :type 'string
+  :group 'tex-continuous)
+
+(defun tex-continuous-process-item (type file line message offset _context 
search-string
   _line-end bad-box _error-point 
ignore)
   "Process an error or warning for the current TeX document.
 The arguments are as in in `TeX-error-list'.  Return either nil or a
-triple (ERROR-P DESCRIPTION (BEG . END)), where ERROR-P is non-nil if
-the error is an error rather than a warning, and the other elements of
-the triple describe the error or warning."
+triple (ERROR-P DESCRIPTION (BEG . END)), where ERROR-P is non-nil if it
+is an error rather than a warning."
   (and
(not ignore)
(stringp file)
@@ -77,7 +82,7 @@ the triple describe the error or warning."
(cons (point) (1+ (point)
  (flymake-diag-region (current-buffer) (+ line offset)
 ((file-equal-p file (TeX-master-file "aux"))
- (and czm-tex-compile-report-multiple-labels
+ (and tex-continuous-report-multiple-labels
   (string-match-p "multiply defined" message)
   (not (eq type 'error))
   (let* ((label (progn
@@ -98,7 +103,7 @@ the triple describe the error or warning."
(replace-regexp-in-string "\n" "" message)
region
 
-(defun czm-tex-compile--error-list (log-file)
+(defun tex-continuous--error-list (log-file)
   "Retrieve parsed TeX error list from LOG-FILE."
   (with-temp-buffer
 (insert-file-contents log-file)
@@ -109,28 +114,28 @@ the triple describe the error or warning."
 (TeX-parse-all-errors)
 TeX-error-list))
 
-(defun czm-tex-compile-process-log ()
+(defun tex-continuous-process-log ()
   "Process log file for current LaTeX document.
 Return a list of triples as in the docstring of
-`czm-tex-compile-process-item'."
+`tex-continuous-process-item'."
   (delq nil (mapcar (lambda (item)
-  (apply #'czm-tex-compile-process-item item))
-(czm-tex-compile--error-list (TeX-master-file "log")
+  (apply #'tex-continuous-process-item item))
+(tex-continuous--error-list (TeX-master-file "log")
 
-(defun czm-tex-compile--compilation-buffer-name ()
+(defun tex-continuous--compilation-buffer-name ()
   "Return the name of the buffer used for LaTeX compilation."
   (let ((master (abbreviate-file-name (expand-file-name (TeX-master-file)
 (format "*pvc-%s*" master)))
 
-(defun czm-tex-compile--compilation-b

  1   2   3   4   >