[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: To Drew Adams?: `dired-get-marked-files' returns error when notonfil
RE: To Drew Adams?: `dired-get-marked-files' returns error when notonfile
Wed, 7 Jul 2010 09:39:52 -0700
> > I have the impression `dired-get-marked-files' should return
> > nil instead signal an error (or at least parameterised) when
> > I am in dired buffer and I am pointing on empty line after
> > all files.
> > why? because how can I handle such situation cleanly in elisp code?
> `dired-get-marked-files' raises an error in this case.
> It calls `dired-get-filename', which raises the error because
> there is no file listed on that line.
BTW - There is a good reason for not returning nil, which means there are no
marked files. If you do in fact have some marked files, and you hit a key to
perform some task on those files, you generally do not want the set of marked
files to be considered empty and the command to act based on that erroneous
And if there are no marked files, or if you use a prefix arg, then
`dired-get-marked-files' returns the next ARG files, including the file under
the cursor. If the cursor is not on a file line then this is problematic, and
an error is in order.