unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Boruch Baum <boruch_baum@gmx.com>
Cc: "48883@debbugs.gnu.org" <48883@debbugs.gnu.org>
Subject: bug#48883: [External] : bug#48883: dired marking bugs
Date: Mon, 7 Jun 2021 15:24:11 +0000	[thread overview]
Message-ID: <SA2PR10MB44741C08BE23C04D93A3822EF3389@SA2PR10MB4474.namprd10.prod.outlook.com> (raw)
In-Reply-To: <20210606224451.32hmmhpsj3tqt5aj@E15-2016.optimum.net>

> > 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	other threads:[~2021-06-07 15:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-06 20:33 bug#48883: dired marking bugs Boruch Baum
2021-06-06 22:12 ` bug#48883: [External] : " Drew Adams
2021-06-06 22:44   ` Boruch Baum
2021-06-07 15:24     ` Drew Adams [this message]
2021-06-07  0:08   ` Boruch Baum
2021-06-07 15:21     ` Drew Adams
2021-06-07 16:16       ` Drew Adams
2021-06-07  0:50   ` Boruch Baum
2021-06-07 18:53 ` Arthur Miller
2021-06-08  0:32   ` Filipp Gunbin
2021-06-08  4:15     ` Arthur Miller
2021-06-08 12:41       ` Filipp Gunbin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SA2PR10MB44741C08BE23C04D93A3822EF3389@SA2PR10MB4474.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=48883@debbugs.gnu.org \
    --cc=boruch_baum@gmx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).