From: Lars Ingebrigtsen Date: Mon, 23 May 2022 10:17:25 +0000 (+0200) Subject: Make `d' in Dired skip dot files X-Git-Tag: emacs-29.0.90~1910^2~488 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4b15b88e714f39ca6926f17b36a1302959b69643;p=emacs.git Make `d' in Dired skip dot files * lisp/dired.el (dired-mark): Skip dot files (bug#38729). This makes `C-u 10 d' (etc) consistent with marking the next ten lines with the mouse and then hitting `d'. --- diff --git a/etc/NEWS b/etc/NEWS index c146b746cfe..032450b6eef 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -136,6 +136,14 @@ of 'user-emacs-directory'. * Incompatible changes in Emacs 29.1 +--- +** The 'd' command in Dired now more consistently skip dot files. +In previous Emacs versions, commands like `C-u 10 d' would put the "D" +mark on the next ten files, no matter whether they were dot files +(i.e., "." and "..") or not, while marking the next ten lines with the +mouse (in 'transient-mark-mode') and then hitting 'd' would skip dot +files. These now work equivalently. + --- ** Isearch in "*Help*" and "*info*" now char-folds quote characters by default. This means that you can say 'C-s `foo' (GRAVE ACCENT) if the buffer diff --git a/lisp/dired.el b/lisp/dired.el index 89fbd52aa62..fbf26dbce7a 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -3957,7 +3957,11 @@ this subdir." (let ((inhibit-read-only t)) (dired-repeat-over-lines (prefix-numeric-value arg) - (lambda () (delete-char 1) (insert dired-marker-char))))))) + (lambda () + (when (or (not (looking-at-p dired-re-dot)) + (not (equal dired-marker-char dired-del-marker))) + (delete-char 1) + (insert dired-marker-char)))))))) (defun dired-unmark (arg &optional interactive) "Unmark the file at point in the Dired buffer.