Function: denote-subdirectory-prompt

denote-subdirectory-prompt is a byte-compiled function defined in denote.el.

Signature

(denote-subdirectory-prompt)

Documentation

Prompt for subdirectory of the variable denote-directory(var)/denote-directory(fun).

The table uses the file completion category (so it works with packages such as marginalia and embark).

Source Code

;; Defined in ~/.emacs.d/elpa/denote-4.2.3/denote.el
;; TODO 2025-12-14: Explore if we can have relative paths here.  The
;; problem is that we also return the root `denote-directory', so how
;; should that be presented?  Maybe as "."?
(defun denote-subdirectory-prompt ()
  "Prompt for subdirectory of the variable `denote-directory'.
The table uses the `file' completion category (so it works with
packages such as `marginalia' and `embark')."
  (let* ((default (car denote-subdirectory-history))
         (roots (denote-directories))
         (single-dir-p (null (cdr roots)))
         ;; Some external program may use `default-directory' with the
         ;; relative file paths of the completion candidates.
         (default-directory (if single-dir-p
                                (car roots)
                              (denote-directories-get-common-root)))
         (subdirectories (denote-directory-subdirectories))
         (directories (append roots subdirectories)))
    (completing-read
     (format-prompt "Select SUBDIRECTORY" default)
     (denote-get-completion-table directories '(category . file))
     nil t nil 'denote-subdirectory-history default)))