Subject: bug#55056: [PATCH] Delete temporary Flymake Elisp files

From: João Távora <[email-masked]>
Date: Fri, 22 Apr 2022 12:57:57 +0100

Lars, your idea sounds pretty reasonable to me.  In fact, you recently
touched
the Ruby backend example checker in the manual.

commit f5b4bb4a6fa3adcb653cab5dc760745b896320bb
Author: Lars Ingebrigtsen <[email-masked]>
Date:   Mon Oct 25 01:25:13 2021 +0200

    Fix flymake example backend conditions in the manual

    * doc/misc/flymake.texi (An annotated example backend): Also react
    to `signal' process statuses (bug#51380).

diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi
--- a/doc/misc/flymake.texi
+++ b/doc/misc/flymake.texi
@@ -777,1 +777,1 @@
-          (when (eq 'exit (process-status proc))
+          (when (memq (process-status proc) '(exit signal))

The only question is why both I and you didn't venture to just use
process-live-p
back then as you propose now.  Because it seems to make sense. I personally
can't recall a reason other than my ignorance/oversight,  but maybe you can?

João

On Fri, Apr 22, 2022 at 12:43 PM Lars Ingebrigtsen <[email-masked]> wrote:

> Philip Kaludercic <[email-masked]> writes:
>
> > The below patch adds a check to the sentinel to do so.  I was a bit
> > paranoid and considered more process-states that might be necessary, but
> > I hope that someone with a better understanding of the process interface
> > will be able to help here.
>
> [...]
>
> > +          (when (memq (process-status proc) '(failed closed signal))
> > +            (message "Elisp flymake [%s]: %S" (buffer-file-name)
> (process-status proc))
> > +            (ignore-errors (delete-file temp-file))
> > +            (kill-buffer output-buffer)))
>
> I'm not very familiar with the flymake machinery, but isn't the problem
> a bit further up?  That is:
>
>         :sentinel
>         (lambda (proc _event)
>           (when (eq (process-status proc) 'exit)
>
> Shouldn't that just be (unless (process-live-p proc) ...)?
>
> Perhaps João has a comment; added to the CCs.
>
> --
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no
>

-- 
João Távora