unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Warren Lynn <wrn.lynn@gmail.com>
To: 64897@debbugs.gnu.org
Subject: bug#64897: 29.0.91; Bug (and patch) in find-dired-with-command
Date: Thu, 27 Jul 2023 10:24:37 -0400	[thread overview]
Message-ID: <CAMyoMRVL=C-2JivmHWKA4ByKJ=x_8g9OXhOcvYkgA5zT7OpGsw@mail.gmail.com> (raw)

[-- 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 --]

             reply	other threads:[~2023-07-27 14:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-27 14:24 Warren Lynn [this message]
2023-07-27 15:55 ` bug#64897: 29.0.91; Bug (and patch) in find-dired-with-command 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMyoMRVL=C-2JivmHWKA4ByKJ=x_8g9OXhOcvYkgA5zT7OpGsw@mail.gmail.com' \
    --to=wrn.lynn@gmail.com \
    --cc=64897@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).