bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#48883: [External] : bug#48883: dired marking bugs


From: Drew Adams
Subject: bug#48883: [External] : bug#48883: dired marking bugs
Date: Mon, 7 Jun 2021 15:24:11 +0000

> > In the second `while' (the one for negative movement),
> > change (save-excursion (funcall function)) to this:
> > (when (dired-get-filename nil t) ; <=======
> >   (save-excursion (funcall function)))
> 
> I don't like that change because it allows operations
> on '.' and '..' which makes me uncomfortable.

OK.

I disagree that ALL operations on `.' and `..' should
be disallowed, but what you say follows what will
likely be wanted for vanilla Emacs, I expect.

My own position (used in Dired+), is that Dired
operations can in principle be anything.

They are operations on the buffer and its text, first
and foremost.  Only some of them are operations on
files and dirs listed in the buffer.

My position (for Dired+, and suggested but not
expected for vanilla Dired) is that it's up to the
particular function whether and how it might be
relevant for `.' or `..'.

Some operations might make sense; others might not.
The idea that NO operation could make sense on `.'
or `..' would be misguided, IMO.  It's unnecessarily
limiting.  `.' and `..' are just names for certain
directories.  Dired doesn't outlaw operations on
other lines that name directories.

[The same is true for shell commands, BTW.  They
don't exclude acting on `.' or `..'.]

> What I see as possibly the issue is function `dired-between-files'. I'm
> not equipped to perform a 'git blame', but the function's comment
> indicated a change at some point, and I suspect that's when the bug
> arose.

The bug exists at least as far back as Emacs 20.

Yes, we could consider that the bug is in
`dired-move-to-filename' (used by
`dired-between-files').  So far, I've chosen to
consider it to be just in `dired-repeat-over-lines'.

> > IMO, there's nothing wrong with marking `.' or `..',
> > and nothing wrong with Dired having some operations
> > that work on them.
> 
> I don't feel comfortable with that. Do you have
> any specific case in mind?

See above.  

BTW, even vanilla Emacs presents some specific cases.

It lets `dired-get-filename' treat `.' and `..' as
regular file names, with non-nil arg
NO-ERROR-IF-NOT-FILEP.

And `dired-find-file' operates normally on `.' and `..'.

[That has always been the case, AFAIK.  But before Emacs
21 it didn't use `dired-get-filename' (via
`dired-get-file-for-visit').  Starting with 21, it has,
passing non-nil NO-ERROR-IF-NOT-FILEP.]

Likewise, `dired-mouse-find-file-other-window' operates
on `.' and `..'.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]