From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Warren Lynn Newsgroups: gmane.emacs.bugs Subject: bug#64897: 29.0.91; Bug (and patch) in find-dired-with-command Date: Thu, 27 Jul 2023 10:24:37 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000001be78060178ba23" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27512"; mail-complaints-to="usenet@ciao.gmane.io" To: 64897@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 27 17:01:53 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qP2Uz-00070x-8Q for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 27 Jul 2023 17:01:53 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qP1vM-0004zD-DH; Thu, 27 Jul 2023 10:25:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qP1vL-0004yx-Ez for bug-gnu-emacs@gnu.org; Thu, 27 Jul 2023 10:25:03 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qP1vL-0005WD-66 for bug-gnu-emacs@gnu.org; Thu, 27 Jul 2023 10:25:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qP1vK-0005qu-LT for bug-gnu-emacs@gnu.org; Thu, 27 Jul 2023 10:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Warren Lynn Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Jul 2023 14:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 64897 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.169046790022484 (code B ref -1); Thu, 27 Jul 2023 14:25:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Jul 2023 14:25:00 +0000 Original-Received: from localhost ([127.0.0.1]:42768 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qP1vI-0005qZ-90 for submit@debbugs.gnu.org; Thu, 27 Jul 2023 10:25:00 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:41536) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qP1vG-0005qO-Bl for submit@debbugs.gnu.org; Thu, 27 Jul 2023 10:24:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qP1vB-0004rj-1t for bug-gnu-emacs@gnu.org; Thu, 27 Jul 2023 10:24:53 -0400 Original-Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qP1v9-0005V3-Ew for bug-gnu-emacs@gnu.org; Thu, 27 Jul 2023 10:24:52 -0400 Original-Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-4fe10f0f4d1so1795132e87.0 for ; Thu, 27 Jul 2023 07:24:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690467889; x=1691072689; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=xQczwtYWV5y9K0vnarY4offZGXtHRffZ6kLAPgM+I+E=; b=SsbCKJFZH6CR5CoKvC6HCScbZX7+2VMvTYFkGQ/7v7JUZC6iIqtYnQ6uO/TuzS315l 6tYiQduT7ycpVrR8ilp+SP/KdCM6jOvdaohyAVQKea+Rt5e5il4trYq5g28nzUb05IH9 kE0W5VnB7xM5aEwCQTmxnq90dLfT9UyA7A28IwRv3avD5CYS6Y3ED78KhpUS9arnhT3h ApsnO5XvakYqpBiFf0KDqxaAr9E8J8SCW+9IFiDFKsx5u/lAlZfdNJnZWdYQmnC61qpm ctzRciBUnuqjIKHgjdMz0P5tpNKtnPIC3oAGTWDwYePvZfQLg61/afMokqSNW22VhZy1 oK0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690467889; x=1691072689; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=xQczwtYWV5y9K0vnarY4offZGXtHRffZ6kLAPgM+I+E=; b=TZmEIQwaW3vI0kZv03vraCNp9X4lvLUoe0mGVjZ2H6RE3TAqpn0xm8L1kzWzbn/r5/ 4QNqESHOaixsIm1Z6G5dqt9v6ImKrDhCQ1yg3PrkDjIxKiXKhz9x18GK9SK3ldRjQtvo w4b2gfZkCb2inATz2+y/Xx7+IoT5Owa7zKYcmnnxuXVZ2kfVlQ5TMT5+CAvSo7VMvfJX DWXcQY3qB8LdQuYTYzLZx/60oNci4qiuWI8yTF7XpsQ8GS51ScTLXNS+R5sakfMZWhHe k4NS9TwCPVejuY6O+0sHL2VqpT/hZuO1GWr2v8nLaX/ZlX3k9ApQB5YmLnbTqfqOkqLq vkVg== X-Gm-Message-State: ABy/qLYszTnZ8uMPI9auRA2D8hAxyVtQbqb0a2Idk8bIm/24knwyV5oX qK5m5AC+RpSBssYpICMRznIL/VGfbBgFQxJa5oq7FKXU6Mo= X-Google-Smtp-Source: APBJJlEPU+Imao+Ht1frHwSCJu7GFNwhUq8gkfSKj4CJ1deUPthXKhuhGUty3MmK5XYUfhsitnvjonEuQtZGp3zvNvs= X-Received: by 2002:a05:6512:3b14:b0:4fb:89cd:9616 with SMTP id f20-20020a0565123b1400b004fb89cd9616mr2831000lfv.0.1690467888641; Thu, 27 Jul 2023 07:24:48 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::130; envelope-from=wrn.lynn@gmail.com; helo=mail-lf1-x130.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:266196 Archived-At: --00000000000001be78060178ba23 Content-Type: text/plain; charset="UTF-8" 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. --00000000000001be78060178ba23 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Linux. When I call "find-name-dired" command,= which in turn invokes "find-dired-with-command" function, in a m= ulti-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= )
=C2=A0 process-mark(nil)
=C2=A0 (move-marker (process-mark proc) (point) (current-buffer))

The issue is around this part of the code:
=C2=A0 =C2=A0 ;; Start the find= process. =C2=A0 =C2=A0
=C2=A0 =C2=A0 (shell-command (concat command &qu= ot;&") (current-buffer))
=C2=A0 =C2=A0 (let ((proc (get-buffer-= process (current-buffer)))) ;; !!!!!!!! proc could be nil here !!!!!!!!!!=C2=A0 =C2=A0 =C2=A0 ;; Initialize the process marker; it is used by the = filter.
=C2=A0 =C2=A0 =C2=A0 (move-marker (process-mark proc) (point) (c= urrent-buffer))

After changing the code to:=

=C2=A0 =C2=A0 ;; Start the find = process.
=C2=A0 =C2=A0 (let ((proc (shell-command (concat command "= &") (current-buffer))))
=C2=A0 =C2=A0 =C2=A0 ;; Initialize the = process marker; it is used by the filter.
=C2=A0 =C2=A0 =C2=A0 (move-mar= ker (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" pac= kage and rely on that for asynchronous event handling.

--00000000000001be78060178ba23--