]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't skip links to "." and ".." in Dired when marking files
authorEli Zaretskii <eliz@gnu.org>
Thu, 8 Feb 2024 11:51:55 +0000 (13:51 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sun, 11 Feb 2024 16:32:52 +0000 (17:32 +0100)
* lisp/dired.el (dired-mark): Skip "." and "..", but not symlinks
to those two.  (Bug#38729)  (Bug#68814)

(cherry picked from commit e2682316867ecb22ee1db5e3028a8150d95d1a80)

lisp/dired.el

index cef93ab757cd48f1aa3428291da901ec08afefee..9e3b888df14fe8506c50b2d8444cb9b3f3aba2d1 100644 (file)
@@ -4321,6 +4321,11 @@ this subdir."
        (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))))))))