From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Liu Hui Newsgroups: gmane.emacs.bugs Subject: bug#56865: M-x find-dired fails with "Wrong type: processp, nil" Date: Thu, 01 Dec 2022 15:33:08 +0800 Message-ID: <87y1rrlgsr.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7672"; mail-complaints-to="usenet@ciao.gmane.io" Cc: michael.albinus@gmx.de, pogonyshev@gmail.com, 56865@debbugs.gnu.org To: larsi@gnus.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 01 08:34:07 2022 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 1p0e59-0001p0-Ou for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 01 Dec 2022 08:34:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p0e55-0006J6-Fj; Thu, 01 Dec 2022 02:34:03 -0500 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 1p0e54-0006Iv-De for bug-gnu-emacs@gnu.org; Thu, 01 Dec 2022 02:34:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p0e54-0002Ah-2B for bug-gnu-emacs@gnu.org; Thu, 01 Dec 2022 02:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p0e53-0005pM-TU for bug-gnu-emacs@gnu.org; Thu, 01 Dec 2022 02:34:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Liu Hui Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Dec 2022 07:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56865 X-GNU-PR-Package: emacs Original-Received: via spool by 56865-submit@debbugs.gnu.org id=B56865.166988000522386 (code B ref 56865); Thu, 01 Dec 2022 07:34:01 +0000 Original-Received: (at 56865) by debbugs.gnu.org; 1 Dec 2022 07:33:25 +0000 Original-Received: from localhost ([127.0.0.1]:37969 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0e4S-0005p0-Sw for submit@debbugs.gnu.org; Thu, 01 Dec 2022 02:33:25 -0500 Original-Received: from mail-pf1-f172.google.com ([209.85.210.172]:35498) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0e4Q-0005ot-Fc for 56865@debbugs.gnu.org; Thu, 01 Dec 2022 02:33:23 -0500 Original-Received: by mail-pf1-f172.google.com with SMTP id l127so453067pfl.2 for <56865@debbugs.gnu.org>; Wed, 30 Nov 2022 23:33:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:in-reply-to:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=k2T8wASUsB1usSOPuciVdM07pBhre4fL/G4matwzMF8=; b=mseHc3sWmriVSHRXWAutOrToSe7wj08TtaeHhdoDm3zOQ4OQSbzPsuaEWQchPGmPTZ 9OAjLueJyKTLrlBRIOcto9KAmZrtEuhyUEmcPWyuIUdcCXPFBIa1PQie6AN7gaKZkVWV qKk0M15XY6/rbEJOrPndsf0ZUEcJhwov9fr8HUg7oNTnvSnCc87N5XARm8CLzwm6ZdMi GPWjZ/aFnXJZHeldx4fZ1l3T5YKQNcd/G+CMGBZDFJ01S09L4yZxXKLATqjFbezBtHSp bBZZjSvFJ4Dvt8tfYc8Fzmn4lwVAFxp9Vu1tIp09+7cW2nxD46yokpU12bFTCqssH1j4 T7CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:in-reply-to:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=k2T8wASUsB1usSOPuciVdM07pBhre4fL/G4matwzMF8=; b=BF/AYkpmoKIDosmo10vkEacezDMkH/tyGJURcTrp3LfGF2AVvul7L7b9VJVzc0odEG pYPhM++S29NKOO0TDHRW0nyQukWu6uBzO4lNjUO+h3qWy2kvqPmwRZt9XNVI2IS88QSV JAZpualX4e8ZYYP9UPo53cevW1cwuuiw0faX5MHp9R88z2JODPznsFyznske+dYGkfJD n7vs+y2RLbQWq1F+NzV9jsQd94B0v40wZFGbRvEZ2Npca4RBuX+kmDs8iaCiB04OLL5A ny0nT2lfN4Zu5t3Vnbosw5FMffMlQzARSOi1TUSLUqkRDjCAozQ0zbfdTLKhiEZD8Je5 S+kw== X-Gm-Message-State: ANoB5pmGYLZsnmv1dk8YH+SRxqucDHLWpGJmIkmJqOqSvS/FiJi6cSj2 BiYENQ/K2sT4XripziLk0yw= X-Google-Smtp-Source: AA0mqf4q9y3GROA+q3uW9UvFWDTOhzOKh2UMihQz2bdW4kG8HCzN+cJtmYVbFZJhLhHCoSmABwC7tg== X-Received: by 2002:a63:4e0a:0:b0:477:96e2:9264 with SMTP id c10-20020a634e0a000000b0047796e29264mr38565923pgb.422.1669879996452; Wed, 30 Nov 2022 23:33:16 -0800 (PST) Original-Received: from HP-Z6-G4 ([112.38.217.10]) by smtp.gmail.com with ESMTPSA id 188-20020a6218c5000000b00574c54423d3sm2617675pfy.145.2022.11.30.23.33.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Nov 2022 23:33:15 -0800 (PST) In-Reply-To: <874jygl66s.fsf@gnus.org> 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:249604 Archived-At: --=-=-= Content-Type: text/plain Hi, I create a patch according to the discussion and find-dired works well now. Best, Hui --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Set-the-filter-sentinel-of-find-process-reliably-in-.patch >From 8fbd85c80909b4cb560ec77cf84374e0a16b41df Mon Sep 17 00:00:00 2001 From: Liu Hui Date: Thu, 1 Dec 2022 15:03:06 +0800 Subject: [PATCH] Set the filter/sentinel of find process reliably in find-dired * lisp/find-dired.el (find-dired-with-command): Use `make-process' rather than `shell-command' to start a find process. --- lisp/find-dired.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lisp/find-dired.el b/lisp/find-dired.el index be3d106912..3d1ece2003 100644 --- a/lisp/find-dired.el +++ b/lisp/find-dired.el @@ -240,12 +240,13 @@ find-dired-with-command (erase-buffer) (setq default-directory dir) ;; Start the find process. - (shell-command (concat command "&") (current-buffer)) - (let ((proc (get-buffer-process (current-buffer)))) - ;; Initialize the process marker; it is used by the filter. - (move-marker (process-mark proc) (point) (current-buffer)) - (set-process-filter proc #'find-dired-filter) - (set-process-sentinel proc #'find-dired-sentinel)) + (make-process + :name "find-dired" + :buffer (current-buffer) + :command (split-string-shell-command command) + :filter #'find-dired-filter + :sentinel #'find-dired-sentinel + :file-handler t) (dired-mode dir (cdr find-ls-option)) (let ((map (make-sparse-keymap))) (set-keymap-parent map (current-local-map)) -- 2.25.1 --=-=-=--