Function: denote-dired-focus

denote-dired-focus is an interactive and byte-compiled function defined in denote.el.

Signature

(denote-dired-focus REGEXP &optional EXCLUDE-MATCH)

Documentation

Filter the current denote-dired buffer to include only files matching REGEXP.

With optional EXCLUDE-MATCH as a prefix argument remove the files matching REGEXP from the buffer.

This is not a new query. It builds on top of the current denote-dired buffer's file list to operate only on those files.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/denote-4.2.3/denote.el
(defun denote-dired-focus (regexp &optional exclude-match)
  "Filter the current `denote-dired' buffer to include only files matching REGEXP.
With optional EXCLUDE-MATCH as a prefix argument remove the files
matching REGEXP from the buffer.

This is not a new query.  It builds on top of the current `denote-dired'
buffer's file list to operate only on those files."
  (interactive
   (if denote-sort-dired--last-files
       (or (denote--user-error-if-not-major-mode 'dired-mode)
           (let ((exclude-p current-prefix-arg))
             (list
              (denote-files-matching-regexp-prompt
               (if exclude-p
                   "Remove files matching REGEXP in Denote Dired buffer"
                 "Show only files matching REGEXP in Denote Dired buffer"))
              exclude-p)))
     (user-error "This is not a `denote-dired' buffer")))
  (denote--user-error-if-not-major-mode 'dired-mode)
  (if-let* ((files denote-sort-dired--last-files))
      (pcase-let* ((`(,last-regexp ,component ,reverse-sort ,exclude-regexp ,_) denote-sort-dired--last-arguments))
        (if exclude-match
            (denote-sort-dired last-regexp component reverse-sort regexp files)
          (denote-sort-dired regexp component reverse-sort exclude-regexp files)))
    (user-error "No last `denote-sort-dired' results to focus on")))