GNU bug report logs -
#68814
29.1; dired fails to mark links to . or .. for deletion
Previous Next
Full log
View this message in rfc822 format
> Date: Mon, 29 Jan 2024 21:36:04 -0600
> From: Devon Sean McCullough <Emacs-hacker2023 <at> jovi.net>
>
> $ mkdir /tmp/scratch
> $ cd /tmp/scratch
> $ ln -s . self
> $ ln -s .. up
> $ ln -s ... ...
> $ emacs .
> Type the letter d three times.
> Dired fails to mark all three files for deletion, unlike prior versions.
Thanks. This is the (unintended) result of fixing bug#38729.
How does the patch below look? Do you see any possible problems with
it? That is, would exempting symlinks from the dot-dot rule cause any
problems?
diff --git a/lisp/dired.el b/lisp/dired.el
index c33569d..d9fbafb 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -4110,6 +4110,11 @@ dired-mark
(prefix-numeric-value arg)
(lambda ()
(when (or (not (looking-at-p dired-re-dot))
+ ;; Don't skip symlinks to ".", "..", etc.
+ (save-excursion
+ (re-search-forward
+ dired-permission-flags-regexp nil t)
+ (eq (char-after (match-beginning 1)) ?l))
(not (equal dired-marker-char dired-del-marker)))
(delete-char 1)
(insert dired-marker-char))))))))
This bug report was last modified 1 year and 162 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.