diff --git a/lisp/dired-x.el b/lisp/dired-x.el index b7ec41aa95f..462fa4ee152 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -629,9 +629,12 @@ Optional fifth argument CASE-FOLD-P specifies the value of (let ((dired-marker-char (if unflag-p ?\s dired-marker-char))) (dired-mark-if (and - ;; not already marked - (= (following-char) ?\s) - ;; uninteresting + (if unflag-p + ;; Already marked. + (not (= (following-char) ?\s)) + ;; Not already marked. + (= (following-char) ?\s)) + ;; Interesting. (let ((fn (dired-get-filename localp t)) ;; Match patterns case-insensitively on case-insensitive ;; systems