auctex
[Top][All Lists]
Advanced

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

Minor texdoc call patch


From: Yuri Lensky
Subject: Minor texdoc call patch
Date: Mon, 30 Sep 2024 02:27:00 -0700

I would like to suggest the following patch, that fixes the use of texdoc in general, but especially when emacs itself is used as the PDF viewer. Please let me know if there is some more standard way (through git or otherwise) to make a pull request.

The older way of calling texdoc would hang emacs when the viewer_pdf was
emacsclient. Moreover, the intended way to send the error message
assumes texdoc is called non-interactively.

* tex.el: use `make-process` to call `texdoc` with `-I` argument.
---
 tex.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tex.el b/tex.el
index 93f2252..5448e94 100644
--- a/tex.el
+++ b/tex.el
@@ -6633,8 +6633,12 @@ enter the number of the file to view, anything else to skip: ") list)))
           ;; Recent Texdoc returns exit code 3 when it can't find the
           ;; specified document, according to
           ;; <URL:https://tug.org/texdoc/doc/texdoc.man1.pdf>
-          (if (= (call-process "texdoc" nil nil nil "--view" pkg) 3)
-              (message "No documentation found for %s" pkg)))))))
+          (make-process
+           :name "texdoc"
+           :command (list "texdoc" "-I" "--view" pkg)
+           :sentinel (lambda (proc string)
+                       (when (= (process-exit-status proc) 3)
+                         (message "No documentation found for %s" pkg)))))))))
 
 (defun TeX-goto-info-page ()
   "Read documentation for AUCTeX in the info system."


Best,

YDL

reply via email to

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