summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Quintana <lmq10@protonmail.com>2025-02-27 12:00:35 -0300
committerLucas Quintana <lmq10@protonmail.com>2025-02-27 12:00:35 -0300
commitefc1b2e8ee30fcfaeb3bb6d9dafec0ef2e17edcc (patch)
tree6a46984f00d2f1261a507e702aff7b77aac41a98
parent988ac9d7a8525b520832d98c764a18b6d53d8122 (diff)
Add a simple command to clean filters
-rw-r--r--denote-search.el12
1 files changed, 11 insertions, 1 deletions
diff --git a/denote-search.el b/denote-search.el
index a85a2d9..daf0abd 100644
--- a/denote-search.el
+++ b/denote-search.el
@@ -418,6 +418,15 @@ See `denote-search-exclude-files-with-keywords' for details."
(denote-search-only-include-files
(mapcar (lambda (kw) (concat "_" kw)) keywords)))
+(defun denote-search-clean-all-filters ()
+ "Run the last search with the full set of files in `denote-directory'.
+
+This effectively gets ride of any interactive filter applied (by the
+means of e.g. `denote-search-exclude-files')."
+ (interactive)
+ (denote-search denote-search--last-query)
+ (message "Cleaned all filters"))
+
;;;; Keymap and mode definition:
(defvar-keymap denote-search-mode-map
@@ -432,7 +441,8 @@ See `denote-search-exclude-files-with-keywords' for details."
"x" #'denote-search-exclude-files
"i" #'denote-search-only-include-files
"X" #'denote-search-exclude-files-with-keywords
- "I" #'denote-search-only-include-files-with-keywords)
+ "I" #'denote-search-only-include-files-with-keywords
+ "G" #'denote-search-clean-all-filters)
(define-minor-mode denote-search-mode
"Minor mode enabled in the buffer generated by `denote-search'.