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

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

bug#48883: dired marking bugs


From: Arthur Miller
Subject: bug#48883: dired marking bugs
Date: Mon, 07 Jun 2021 20:53:02 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Boruch Baum <boruch_baum@gmx.com> writes:

> In testing my diredc package, 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.
I have no idea if that is "correct and expected behaviour", I don't see
it said in manual, or I missed it, but anyway, the headline in Dired is
a waste of space since you can see dir name in modeline or frame title,
and '.' and '..' are just a design misstake in Unix OS; should have
never been exposed to users as files. Just turn off those things
(dired-omit-mode), you will probably be better without them. :-). Sorry
if I sound negative.

>    1.2) Likewise, typing 'u' on that line unmarks all said lines.
'U' unmarks everything, no need to put cursor to headline ever.

>    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.
>
>    1.5) Attempting to perform an operation on the marked directory line
>         (eg. 'C' to copy it) returns the message "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.
Have you checked the code. Not a bug, feature :).

> 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.
Yeah, that is annoying, I agree with you. For my own use, I have thse
two functions, so I never place cursor on either headline or one past
last filename:

#+begin_src emacs-lisp

(defun dired-go-to-first ()
  (interactive)
  (goto-char (point-min))
  (dired-next-line 1)
  (skip-chars-forward " \n\t"))

(defun dired-go-to-last ()
  (interactive)
  (goto-char (point-max))
  (dired-next-line -1)
  (skip-chars-forward " \n\t"))
  
#+end_src






reply via email to

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