emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: ELPA Syncer
Subject: [elpa] externals/auctex-cont-latexmk b73ac67b86 085/100: New command tex-continuous-help-at-point
Date: Thu, 6 Jun 2024 03:57:58 -0400 (EDT)

branch: externals/auctex-cont-latexmk
commit b73ac67b86cfd2f338d51e859d03ada6e9276f3c
Author: Paul Nelson <ultrono@gmail.com>
Commit: Paul Nelson <ultrono@gmail.com>

    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)



reply via email to

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