[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#12145: Fix causes problems with other processes
From: |
Michael Albinus |
Subject: |
bug#12145: Fix causes problems with other processes |
Date: |
Thu, 02 Mar 2023 18:03:16 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Thomas Koch <thomas@koch.ro> writes:
Hi Thomas,
> The problem identified by the first backtrace still exists even with the
> patch for this bug from 2012. It happens, when find-name-dired on a remote
> system returns very fast (or maybe when the output is very short?), e.g. when
> called on an empty directory.
>
> The function `find-dired` starts a background shell process:
>
> (shell-command (concat args "&") (current-buffer))
>
> A few lines later, the function asks for the process and uses it without any
> error checking:
>
> (let ((proc (get-buffer-process (current-buffer))))
> (set-process-filter proc (function find-dired-filter))
>
> I assume, that get-buffer-process returns nil when the process has already
> terminated.
Good analysis, thanks. I'll play with this, hopefully I can reproduce.
On a first glance (w/o testing), something like this could work:
(let (proc)
(while (not (process-alive-p (setq proc (get-buffer-process
(current-buffer))))))
(set-process-filter proc (function find-dired-filter))
...)
> I don't have an idea about the second backtrace yet. But given that the code
> of find-name-dired seems problematic, this might be a motivation to not
> search for a fix in tramp but in find-name-dired (and called functions).
I'll check.
Best regards, Michael.