GNU bug report logs - #64897
29.0.91; Bug (and patch) in find-dired-with-command

Previous Next

Package: emacs;

Reported by: Warren Lynn <wrn.lynn <at> gmail.com>

Date: Thu, 27 Jul 2023 14:25:02 UTC

Severity: normal

Found in version 29.0.91

Fixed in version 29.2

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#64897: closed (29.0.91; Bug (and patch) in find-dired-with-command)
Date: Mon, 31 Jul 2023 15:54:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Mon, 31 Jul 2023 17:53:43 +0200
with message-id <87edko6prs.fsf <at> gmx.de>
and subject line Re: bug#64897: 29.0.91; Bug (and patch) in find-dired-with-command
has caused the debbugs.gnu.org bug report #64897,
regarding 29.0.91; Bug (and patch) in find-dired-with-command
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
64897: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=64897
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Warren Lynn <wrn.lynn <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.91; Bug (and patch) in find-dired-with-command
Date: Thu, 27 Jul 2023 10:24:37 -0400
[Message part 3 (text/plain, inline)]
On Linux. When I call "find-name-dired" command, which in turn invokes
"find-dired-with-command" function, in a multi-hop tramp remote directory,
an error will occur in side the function, with backtrace (only shown lowest
level):

Debugger entered--Lisp error: (wrong-type-argument processp nil)
  process-mark(nil)
  (move-marker (process-mark proc) (point) (current-buffer))

The issue is around this part of the code:

    ;; Start the find process.
    (shell-command (concat command "&") (current-buffer))
    (let ((proc (get-buffer-process (current-buffer)))) ;; !!!!!!!! proc
could be nil here !!!!!!!!!!
      ;; Initialize the process marker; it is used by the filter.
      (move-marker (process-mark proc) (point) (current-buffer))

After changing the code to:

    ;; Start the find process.
    (let ((proc (shell-command (concat command "&") (current-buffer))))
      ;; Initialize the process marker; it is used by the filter.
      (move-marker (process-mark proc) (point) (current-buffer))

I do not have the error any more.

However, I observe that even with my fix above, the behavior is not
completely right. Sometimes, the (found) file entries appear before the
dired buffer header line. My impression of the code is it does not handle
asynchronous timing in a robust way, and that is more of a problem when the
command is invoked from a remote directory. Probably some serious revamp is
needed here, which is beyond my expertise. Maybe Emacs should include the
"aio" package and rely on that for asynchronous event handling.
[Message part 4 (text/html, inline)]
[Message part 5 (message/rfc822, inline)]
From: Michael Albinus <michael.albinus <at> gmx.de>
To: Warren Lynn <wrn.lynn <at> gmail.com>
Cc: 64897-done <at> debbugs.gnu.org
Subject: Re: bug#64897: 29.0.91; Bug (and patch) in find-dired-with-command
Date: Mon, 31 Jul 2023 17:53:43 +0200
Version: 29.2

Warren Lynn <wrn.lynn <at> gmail.com> writes:

> Hi Michael:

Hi Warren,

> I tried out your patch and could no longer reproduce the problem, of
> either the nil proc or the timing. Thanks a lot for such quick work.

I've pushed the patch to the emacs-29 branch. Closing the bug.

> Warren

Best regards, Michael.


This bug report was last modified 2 years and 9 days ago.

Previous Next


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