unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#64897: 29.0.91; Bug (and patch) in find-dired-with-command
@ 2023-07-27 14:24 Warren Lynn
  2023-07-27 15:55 ` Michael Albinus
  0 siblings, 1 reply; 18+ messages in thread
From: Warren Lynn @ 2023-07-27 14:24 UTC (permalink / raw)
  To: 64897

[-- Attachment #1: Type: text/plain, Size: 1548 bytes --]

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.

[-- Attachment #2: Type: text/html, Size: 2025 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2023-08-15  3:15 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-27 14:24 bug#64897: 29.0.91; Bug (and patch) in find-dired-with-command Warren Lynn
2023-07-27 15:55 ` Michael Albinus
     [not found]   ` <CAMyoMRXkC+UkeHSpA7gZdUXkHySFqjDOni6hjoUVWCWg47KVow@mail.gmail.com>
     [not found]     ` <87sf985m0m.fsf@gmx.de>
     [not found]       ` <CAMyoMRUL6nEyLa2B8rnrq_9C3jVfBRpzo_N6L433M1RHN0CB6A@mail.gmail.com>
2023-07-31 15:53         ` Michael Albinus
2023-08-05 23:35   ` Michael Heerdegen
2023-08-06 11:02     ` Michael Albinus
2023-08-07  1:17       ` Michael Heerdegen
2023-08-07  2:17         ` Michael Heerdegen
2023-08-12  3:50       ` Michael Heerdegen
2023-08-12 12:38         ` Michael Albinus
2023-08-13  4:02           ` Michael Heerdegen
2023-08-13  7:42             ` Michael Albinus
2023-08-13  8:20               ` Eli Zaretskii
2023-08-13  9:33                 ` Michael Albinus
2023-08-13  9:46                   ` Eli Zaretskii
2023-08-13 10:01                     ` Michael Albinus
2023-08-14  1:25                     ` Michael Heerdegen
2023-08-14 11:52                       ` Eli Zaretskii
2023-08-15  3:15                         ` Michael Heerdegen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).