Subject: Re: bug#30285: dired-do-chmod vs. top line of dired

From: Juri Linkov <[email-masked]>
Date: Wed, 31 Jan 2018 23:35:09 +0200

>> I propose to add a new predicate
>> `dired-marked-files-or-file-at-point-p', and used it in all those
>> commands.
>
> Please don't do any such thing.
>
> Yes, it makes sense for such commands to do nothing or to show an
> error message when on the "top line of dired", as described in the
> bug report.

Instead of doing nothing or showing an error message, how about
doing a more useful thing: when on the top line, ‘dired-do-chmod’
could do chmod on all files in the dir.

This is exactly what other Dired commands already do: e.g. typing ‘m’
on the top line or on any other subdir headerline, they perform
their actions on all files.

For example, see the docstring of ‘dired-mark’:

  “If on a subdir headerline, mark all its files except `.' and `..'.”

> No, we don't need a function `dired-marked-files-or-file-at-point-p',
> for that or anything else.  The `dired-do-*' commands already DTRT
> wrt the marked-files-or-file-at-point.

I agree that it's better to check the ‘files’ returned from
‘dired-get-marked-files’.