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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 34645 in the body.
You can then email your comments to 34645 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-auctex <at> gnu.org:
bug#34645; Package auctex. (Mon, 25 Feb 2019 12:15:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Reuben Thomas <rrt <at> sc3d.org>:
New bug report received and forwarded. Copy sent to bug-auctex <at> gnu.org. (Mon, 25 Feb 2019 12:15:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Reuben Thomas <rrt <at> sc3d.org>
To: bug-auctex <bug-auctex <at> gnu.org>
Subject: Make TeX-process-check prompt optional?
Date: Mon, 25 Feb 2019 12:13:51 +0000
[Message part 1 (text/plain, inline)]
I find myself frequently being prompted by TeX-process-check while editing
a document that takes a long time to process. I always want to kill the
process and start a new one.

Would it be possible to add an option to disable the prompt, or is there
some reason why the prompt should always be offered?

I guess that in situations like mine an even better behaviour might be to
always let a run continue until it is done, but to queue up another run
when some change is outstanding. That way, one does not risk the output
document not updating for a long time if frequent edits are being made and
no LaTeX run ever completes, because it is always being interrupted.

Finally, I noticed one typo (version 12.1.2 of AUCTeX): the docstring of
TeX-process-check says "exist", and should say "exists".

For now, I just redefined TeX-process-check in my init sequence to omit the
prompt.

-- 
https://rrt.sc3d.org
[Message part 2 (text/html, inline)]

Information forwarded to bug-auctex <at> gnu.org:
bug#34645; Package auctex. (Tue, 12 Mar 2024 18:03:01 GMT) Full text and rfc822 format available.

Message #8 received at 34645 <at> debbugs.gnu.org (full text, mbox):

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

> I find myself frequently being prompted by TeX-process-check while
> editing a document that takes a long time to process. I always want to
> kill the process and start a new one.
>
> Would it be possible to add an option to disable the prompt, or is
> there some reason why the prompt should always be offered?

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

Hi Reuben,

are you thinking about something like this:

--8<---------------cut here---------------start------------->8---
(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."
  (let (process)
    (while (and (setq process (TeX-process name))
                (eq (process-status process) 'run))
      (cond
       ((or TeX-kill-process-no-query ; (t or nil)
            (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"))))))
--8<---------------cut here---------------end--------------->8---

> I guess that in situations like mine an even better behaviour might be
> to always let a run continue until it is done, but to queue up another
> run when some change is outstanding. That way, one does not risk the
> output document not updating for a long time if frequent edits are
> being made and no LaTeX run ever completes, because it is always being
> interrupted.

Hmm, not sure about this idea.  This sounds like running LaTeX
continuously.  What do others think?

> Finally, I noticed one typo (version 12.1.2 of AUCTeX): the docstring
> of TeX-process-check says "exist", and should say "exists".

Thanks, I fixed this.

Again, sorry for being late.

Best, Arash




Information forwarded to bug-auctex <at> gnu.org:
bug#34645; Package auctex. (Tue, 12 Mar 2024 18:26:01 GMT) Full text and rfc822 format available.

Message #11 received at 34645 <at> debbugs.gnu.org (full text, mbox):

From: Reuben Thomas <rrt <at> sc3d.org>
To: Arash Esbati <arash <at> gnu.org>
Cc: 34645 <at> debbugs.gnu.org
Subject: Re: bug#34645: Make TeX-process-check prompt optional?
Date: Tue, 12 Mar 2024 19:23:31 +0100
[Message part 1 (text/plain, inline)]
On Tue, 12 Mar 2024 at 18:59, Arash Esbati <arash <at> gnu.org> wrote:

>
> are you thinking about something like this:
>
> --8<---------------cut here---------------start------------->8---
> (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."
>   (let (process)
>     (while (and (setq process (TeX-process name))
>                 (eq (process-status process) 'run))
>       (cond
>        ((or TeX-kill-process-no-query ; (t or nil)
>             (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"))))))
> --8<---------------cut here---------------end--------------->8---
>

Yes, that looks good!

Thanks for looking at this old bug report.

-- 
https://rrt.sc3d.org
[Message part 2 (text/html, inline)]

Information forwarded to bug-auctex <at> gnu.org:
bug#34645; Package auctex. (Tue, 12 Mar 2024 20:17:02 GMT) Full text and rfc822 format available.

Message #14 received at 34645 <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: 34645 <at> debbugs.gnu.org
Subject: Re: 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




Information forwarded to bug-auctex <at> gnu.org:
bug#34645; Package auctex. (Tue, 12 Mar 2024 22:09:02 GMT) Full text and rfc822 format available.

Message #17 received at 34645 <at> debbugs.gnu.org (full text, mbox):

From: Reuben Thomas <rrt <at> sc3d.org>
To: Arash Esbati <arash <at> gnu.org>
Cc: 34645 <at> debbugs.gnu.org
Subject: Re: bug#34645: Make TeX-process-check prompt optional?
Date: Tue, 12 Mar 2024 23:06:51 +0100
[Message part 1 (text/plain, inline)]
On Tue, 12 Mar 2024 at 21:16, Arash Esbati <arash <at> gnu.org> wrote:

> 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?
>

I think it does make sense to make it file-local, as one could be engaged
in quite different workflows and want different behaviours.

-- 
https://rrt.sc3d.org
[Message part 2 (text/html, inline)]

Reply sent to Arash Esbati <arash <at> gnu.org>:
You have taken responsibility. (Wed, 13 Mar 2024 12:41:02 GMT) Full text and rfc822 format available.

Notification sent to Reuben Thomas <rrt <at> sc3d.org>:
bug acknowledged by developer. (Wed, 13 Mar 2024 12:41:02 GMT) Full text and rfc822 format available.

Message #22 received at 34645-done <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: 34645-done <at> debbugs.gnu.org
Subject: Re: bug#34645: Make TeX-process-check prompt optional?
Date: Wed, 13 Mar 2024 13:40:13 +0100
Reuben Thomas <rrt <at> sc3d.org> writes:

> I think it does make sense to make it file-local, as one could be
> engaged in quite different workflows and want different behaviours.

Thanks.  I pushed that change now (406eb61fc1), so I'm closing this
report.

Best, Arash




Information forwarded to bug-auctex <at> gnu.org:
bug#34645; Package auctex. (Wed, 13 Mar 2024 12:51:02 GMT) Full text and rfc822 format available.

Message #25 received at 34645-done <at> debbugs.gnu.org (full text, mbox):

From: Reuben Thomas <rrt <at> sc3d.org>
To: Arash Esbati <arash <at> gnu.org>
Cc: 34645-done <at> debbugs.gnu.org
Subject: Re: bug#34645: Make TeX-process-check prompt optional?
Date: Wed, 13 Mar 2024 13:48:21 +0100
[Message part 1 (text/plain, inline)]
On Wed, 13 Mar 2024 at 13:40, Arash Esbati <arash <at> gnu.org> wrote:

> Reuben Thomas <rrt <at> sc3d.org> writes:
>
> > I think it does make sense to make it file-local, as one could be
> > engaged in quite different workflows and want different behaviours.
>

Many thanks for addressing this report and adding the functionality
requested!

-- 
https://rrt.sc3d.org
[Message part 2 (text/html, inline)]

Information forwarded to bug-auctex <at> gnu.org:
bug#34645; Package auctex. (Wed, 13 Mar 2024 12:58:01 GMT) Full text and rfc822 format available.

Message #28 received at 34645-done <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: 34645-done <at> debbugs.gnu.org
Subject: Re: bug#34645: Make TeX-process-check prompt optional?
Date: Wed, 13 Mar 2024 13:57:10 +0100
Reuben Thomas <rrt <at> sc3d.org> writes:

> Many thanks for addressing this report and adding the functionality
> requested!

Sure, welcome.  Thanks for your patience, and again my apologies it took
so ridiculously long.

Best, Arash




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 11 Apr 2024 11:24:22 GMT) Full text and rfc822 format available.

This bug report was last modified 15 days ago.

Previous Next


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