GNU bug report logs - #34645
Make TeX-process-check prompt optional?

Previous Next

Package: auctex;

Reported by: Reuben Thomas <rrt <at> sc3d.org>

Date: Mon, 25 Feb 2019 12:15:02 UTC

Severity: normal

Done: Arash Esbati <arash <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Arash Esbati <arash <at> gnu.org>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: 34645 <at> debbugs.gnu.org
Subject: bug#34645: Make TeX-process-check prompt optional?
Date: Tue, 12 Mar 2024 21:15:23 +0100
Reuben Thomas <rrt <at> sc3d.org> writes:

> Yes, that looks good!

Thanks for your swift response.  My plan is to install the following
change (incl. addition to manual etc.).  Does it make sense to have the
custom variable settable on a per file basis or is it overkill?

--8<---------------cut here---------------start------------->8---
diff --git a/tex.el b/tex.el
index d53ef39b..f69c85ae 100644
--- a/tex.el
+++ b/tex.el
@@ -8769,22 +8769,31 @@ Return nil only if no process buffer exists."
           t)
       nil)))

+(defcustom TeX-kill-process-without-query nil
+  "If non-nil, abort a running document process without user query."
+  :group 'TeX-command
+  :type 'boolean
+  :local t
+  :safe #'booleanp)
+
 (defun TeX-process-check (name)
   "Check if a process for the TeX document NAME already exists.
 If so, give the user the choice of aborting the process or the current
-command."
+command.  If the value of `TeX-kill-process-without-query' is non-nil,
+user query is skipped and the process is aborted right away."
   (let (process)
     (while (and (setq process (TeX-process name))
                 (eq (process-status process) 'run))
       (cond
-       ((yes-or-no-p (concat "Process `"
-                             (process-name process)
-                             "' for document `"
-                             name
-                             "' running, kill it? "))
+       ((or TeX-kill-process-without-query
+            (yes-or-no-p (concat "Process `"
+                                 (process-name process)
+                                 "' for document `"
+                                 name
+                                 "' running, kill it? ")))
         (delete-process process))
        ((eq (process-status process) 'run)
-           (error "Cannot have two processes for the same document"))))))
+        (error "Cannot have two processes for the same document"))))))

 (defun TeX-process-buffer-name (name)
   "Return name of AUCTeX buffer associated with the document NAME."
--8<---------------cut here---------------end--------------->8---

> Thanks for looking at this old bug report.

You're welcome, and again sorry it took so long.

Best, Arash




This bug report was last modified 1 year and 127 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.