From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#48072: 28.0.50: dired-read-shell-command: handle empty input properly [PATCH] Date: Wed, 28 Apr 2021 14:13:38 +0200 Message-ID: <87im4661zh.fsf@gmx.de> References: <20210427190243.n5yg3gywd5wma3jl@E15-2016.optimum.net> <87y2d2brhy.fsf@gmx.de> <20210428120011.5g73ctmekbff42gf@E15-2016.optimum.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19275"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 48072@debbugs.gnu.org To: Boruch Baum Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 28 14:14:25 2021 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 1lbj5D-0004u2-Lf for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 28 Apr 2021 14:14:23 +0200 Original-Received: from localhost ([::1]:46892 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lbj5C-0000EX-OQ for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 28 Apr 2021 08:14:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54862) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lbj4s-0000Dt-Mc for bug-gnu-emacs@gnu.org; Wed, 28 Apr 2021 08:14:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40411) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lbj4s-0005ks-FU for bug-gnu-emacs@gnu.org; Wed, 28 Apr 2021 08:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lbj4s-00063M-AM for bug-gnu-emacs@gnu.org; Wed, 28 Apr 2021 08:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 28 Apr 2021 12:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48072 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 48072-submit@debbugs.gnu.org id=B48072.161961203123244 (code B ref 48072); Wed, 28 Apr 2021 12:14:02 +0000 Original-Received: (at 48072) by debbugs.gnu.org; 28 Apr 2021 12:13:51 +0000 Original-Received: from localhost ([127.0.0.1]:51957 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lbj4g-00062q-RQ for submit@debbugs.gnu.org; Wed, 28 Apr 2021 08:13:51 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:56815) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lbj4c-00062X-CD for 48072@debbugs.gnu.org; Wed, 28 Apr 2021 08:13:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1619612020; bh=U2WsUN/YP0u/UC4jAUqwu3qrwZTzUBRFCOXu2MOEDlg=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=QP/YSM05z2xHudXJGAUJYvpsMhXdNDfsMpS+jPn6YD/ABpFfeODpB0IjjkPv3wGmY iiErj+1l2uqHzrB4d/CifvLRcG9EHbLMQEeYEzxnXavz7zcZ7X79ue6VifamdIPEXx SZdhVfuO04fDoaHW28hnm0+dRnLl/HeX9d0JZP6Y= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([213.220.147.93]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MLi8g-1ltFvH3QvY-00HhTV; Wed, 28 Apr 2021 14:13:39 +0200 In-Reply-To: <20210428120011.5g73ctmekbff42gf@E15-2016.optimum.net> (Boruch Baum's message of "Wed, 28 Apr 2021 08:00:11 -0400") X-Provags-ID: V03:K1:l9UofiIEZF8fZrXxxwZzy1mFONh9T1OlX18W6mBhset+JHbkU34 RSFFnZoFE1/rD+BhL0SR4HELpYtdqvH2kpk3x5pupmgvzvD7FWUVCIBg4SCkWF9lt4UHjpw Sm/E6r93lcsFXfkwdh/QWV/e/ZWGMGsj4aC1llZ+Ds/mSN0i7/VFyoAxcl38tFX/kU1Ny8I rhFAbTGySUh+l666te54w== X-UI-Out-Filterresults: notjunk:1;V03:K0:fOMemH9JmHw=:Ni3o6KuaB6Qowo6LFThYae 8FrOGmAS3W8hkwsGt/zaYIBD2Mj9vMy2dlrh9NZEypxlBg9gEEgEpb7IBrBWxinBxeBirC6Oy r6qlWJgf3FC01gE4SqqCMG0hgQGDMNvM40HznqYn8okVDMjwVW0xlGXkjYqMPurkjQ7hxy0Rq mZGrgvToNnqzBXw+4n5CYfc0LJOCWVt3sZOiGnogopVAqjlIhcRIGOlgwNp2LQBJtm3ipYn8C kdPBoec/Cg+o5fBzzDWoY7dmU4BUrxwQkoZLv7p4+7qbZgTIY8OWSe4uuFOU0Vld2UU/JJpv1 pDAznH3uJcp12PQnKChD2GxU74Rw/ldRxLC84/QYkBGnw90NeeG0FE7mxQ2GCOKBROYLvbYA6 NGg8W3WZBR9uF9LSNKYoPQWwwFCSQQYg9rcxAOTMkbsZwUwGPG9J/suTIxhExJl1qJFS4tFcs Jm38HDT5SQVVb7VGsr+q36wzFlkYIe9BsZ25gCV/LlmfCOBLhDUPMa1bVx3BJzHeMu5nxvr0y OWK/+peqUEgYpF1OCCe8l2qYrVKOz0MyjPlwMsQFIeHWrJGg+OopjNskvf0WZSLasRgon30Xl nkcKDJiQv9p/rkXaTHSu8/4+UakaHa8QdeeNNl5BnVl0qLZEoz1VMWTJ1Z1KinI+vwRK2G2qM 2yD9Mprik2VEwWuWeWhlNQtZoea7qSircF0xIrTbEJGTlcYT9+YnG3pW+Q/U3EgteMPvUW5Mm qqlxPmwPwcWpuYI87s5+bPuUvxew9UTEqIGV3YIsoTbpZpMhnl2P/ARu2WeZPutP+yqw041R 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" Xref: news.gmane.io gmane.emacs.bugs:205103 Archived-At: Boruch Baum writes: Hi Boruch, >> > + (unless (executable-find command) >> > + (user-error "Not a valid command!")) >> >> This doesn't check the remote case. > > Good point. It's an area of dired I'm weak in because I don't use it. > How about the following (with the update diredc regex): > > (unless (executable-find > (if (string-match "^ *\\([^ ]+\\) " command) > (substring command (match-beginning 1) (match-end 1)) > command) > (file-remote-p file)) > (user-error "Not a valid command!")) Instead of (file-remote-p file) you could always use t. If default-directory is local, it doesn't hurt. Best regards, Michael.