Subject: bug#48072: 28.0.50: dired-read-shell-command: handle empty input properly [PATCH]

From: Michael Albinus <[email-masked]>
Date: Wed, 28 Apr 2021 14:13:38 +0200

Boruch Baum <[email-masked]> 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.