branch: externals/filechooser
commit 4d63cddab4b6f21d8c6ca2921bb9b9029fe78466
Author: Rahguzar <rahgu...@zohomail.eu>
Commit: Rahguzar <rahgu...@zohomail.eu>

    Remove marks from invisible/filtered files
---
 filechooser.el | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/filechooser.el b/filechooser.el
index 772aecaaf9..5946218766 100644
--- a/filechooser.el
+++ b/filechooser.el
@@ -480,16 +480,19 @@ without exiting file selection."
     "Deal with change in mark from BEG to END."
     (when (and filechooser-dired-selection-mode
                (derived-mode-p 'dired-mode)
-               (eq (1+ beg) end)
-               (not (invisible-p (1- (pos-eol))))
-               (filechooser--filters-predicate (dired-get-filename 'no-dir t)))
+               (eq (1+ beg) end))
       (save-excursion
         (goto-char beg)
-        (when (and (re-search-forward dired-re-mark end t)
-                   (eq (preceding-char) dired-marker-char))
+        (cond
+         ((or (invisible-p (1- (pos-eol)))
+              (not (filechooser--filters-predicate
+                    (dired-get-filename 'no-dir t))))
+          (dired-unmark nil))
+         ((and (re-search-forward dired-re-mark end t)
+               (eq (preceding-char) dired-marker-char))
           (puthash (dired-get-filename nil t) t selection))
-        (when (re-search-forward dired-re-maybe-mark (1+ end) t)
-          (remhash (dired-get-filename nil t) selection))
+         ((and (re-search-forward dired-re-maybe-mark (1+ end) t))
+          (remhash (dired-get-filename nil t) selection)))
         (unless timer
           (setq timer (run-with-timer
                        filechooser-dired-selection-debounce nil

Reply via email to