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>,
	"48883@debbugs.gnu.org" <48883@debbugs.gnu.org>
Subject: bug#48883: [External] : bug#48883: dired marking bugs
Date: Sun, 6 Jun 2021 22:12:20 +0000	[thread overview]
Message-ID: <SA2PR10MB4474162BFF0E14940945ED16F3399@SA2PR10MB4474.namprd10.prod.outlook.com> (raw)
In-Reply-To: <20210606203356.muhmgel5m2jwmzpj@E15-2016.optimum.net>

I'll chime in here, unsolicited - feel free to ignore.

Glad you reported this, Boruch.  Congratulations on
finding a decades-old problem!

> I'm coming across the following bugs
> reproducable in \emacs -Q -nw:
> 
> 1) Improper marking of directory heading line
> 
>    1.1) The correct and expected behavior of dired is that when one
>         navigates to a directory heading line (eg. the first line of a
>         simple dired buffer) and presses 'm', all "real" files of that
>         directory are marked, [IMPORTANT] the lines for the "not-real"
>         files '.' and '..' are not marked, and [IMPORTANT] the directory
>         line itself is not marked.
> 
>    1.2) Likewise, typing 'u' on that line unmarks all said lines.

(You don't say so, but I think/hope you agree that
1.1 and 1.2 are OK, not something improper.)

>    1.3) Now, advance one line, to the line typically presenting a
>         summary, beginning with the word 'total', and press the sequence
>         'C-u -1 m'.
> 
>    1.4) Why is there now a mark on the prior line, the directory line?
>         Note that the result differs from actually performing 'm' on
>         that line also in that none of the "real" files in the directory
>         are marked. Note also that performing 'u' on the line does not
>         remove the mark, but performing 'U' on the buffer does.

Agreed - a bug.

This change to `dired-repeat-over-lines' seems to
take care of that OK:

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've added `dired-repeat-over-lines' to dired+.el and
made that change.  If this gets fixed in vanilla Dired
too (hopefully) then I'll be able to remove that
dired+.el change - except for older Emacs versions.] 

>    1.5) Attempting to perform an operation on the marked directory line
>         (eg. 'C' to copy it) returns the message "No files specified"

IMO, that's not a problem.  (I assume here you're
talking about point being on the dir heading line
and no (other) files being marked.)  There _are_
(should be) no files specified.

> 2) Improper marking of "not-real" files '.' and '..'
> 
>    2.1) See paragraph 1.1.
> 
>    2.2) However, those lines can be manually marked using the 'm'
>         command, and attempting to perform an operation on them (eg. 'C'
>         to copy them) returns messaging indicating a willingness to
>         overwrite whatever target directory is chosen. I haven't risked
>         let it operate.
> 
>    2.3) As in paragraph 1.3, it is possible to mark the two lines using
>         a negative prefix argument.

IMO, there's nothing wrong with marking `.' or `..',
and nothing wrong with Dired having some operations
that work on them.

It's fine for it to have some other operations that
don't work for them, of course.  In that case, users
can be informed about that when they try those ops.

> 3) Improper advancing to (point-max)
> 
>    3.1) Marking the final entry in a dired buffer advances POINT to a
>         blank line, which is pretty much never desirable to a user.

I don't see that as a problem.  FWIW, with my code
(`dired+.el') a user can optionally wrap around from
the last line to the first, and vice versa, using the
line motion commands (e.g. `SPC', `down').






  reply	other threads:[~2021-06-06 22:12 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 ` Drew Adams [this message]
2021-06-06 22:44   ` bug#48883: [External] : " Boruch Baum
2021-06-07 15:24     ` Drew Adams
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=SA2PR10MB4474162BFF0E14940945ED16F3399@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).