nit: formatting update

My editor reformatted some of the identation.  Also corrected a
docstring for org-roam-refile.
This commit is contained in:
Dustin Farris
2025-02-17 10:29:23 -08:00
parent 425d53d56d
commit 40b6c10d8a
3 changed files with 23 additions and 17 deletions

View File

@ -68,10 +68,10 @@ to be used like this. See https://nullprogram.com/blog/2014/02/06/."
:package-version '(forge . "0.3.0") :package-version '(forge . "0.3.0")
:group 'org-roam :group 'org-roam
:type '(choice (const sqlite) :type '(choice (const sqlite)
(const sqlite-builtin) (const sqlite-builtin)
(const sqlite-module) (const sqlite-module)
(const :tag "libsqlite3 (OBSOLETE)" libsqlite3) (const :tag "libsqlite3 (OBSOLETE)" libsqlite3)
(const :tag "sqlite3 (BROKEN)" sqlite3))) (const :tag "sqlite3 (BROKEN)" sqlite3)))
(defcustom org-roam-db-location (locate-user-emacs-file "org-roam.db") (defcustom org-roam-db-location (locate-user-emacs-file "org-roam.db")
"The path to file where the Org-roam database is stored. "The path to file where the Org-roam database is stored.
@ -126,8 +126,9 @@ is desirable to parse and cache these links (e.g. hiding links in
a property drawer)." a property drawer)."
:package-version '(org-roam . "2.2.0") :package-version '(org-roam . "2.2.0")
:group 'org-roam :group 'org-roam
:type '(set (const :tag "keywords" keyword) :type '(set
(const :tag "property drawers" node-property))) (const :tag "keywords" keyword)
(const :tag "property drawers" node-property)))
(defcustom org-roam-db-extra-links-exclude-keys '((node-property . ("ROAM_REFS")) (defcustom org-roam-db-extra-links-exclude-keys '((node-property . ("ROAM_REFS"))
(keyword . ("transclude"))) (keyword . ("transclude")))

View File

@ -309,7 +309,8 @@ Return nil if there's no node with such REF."
Uses the ID, and fetches remaining details from the database. Uses the ID, and fetches remaining details from the database.
This can be quite costly: avoid, unless dealing with very few This can be quite costly: avoid, unless dealing with very few
nodes." nodes."
(when-let ((node-info (car (org-roam-db-query [:select [file level pos todo priority (when-let ((node-info (car (org-roam-db-query [:select [
file level pos todo priority
scheduled deadline title properties olp] scheduled deadline title properties olp]
:from nodes :from nodes
:where (= id $s1) :where (= id $s1)
@ -417,8 +418,9 @@ FROM
GROUP BY id, tags ) GROUP BY id, tags )
GROUP BY id"))) GROUP BY id")))
(cl-loop for row in rows (cl-loop for row in rows
append (pcase-let* ((`(,id ,file ,file-title ,level ,todo ,pos ,priority ,scheduled ,deadline append (pcase-let* ((`(
,title ,properties ,olp ,atime ,mtime ,tags ,aliases ,refs) ,id ,file ,file-title ,level ,todo ,pos ,priority ,scheduled ,deadline
,title ,properties ,olp ,atime ,mtime ,tags ,aliases ,refs)
row) row)
(all-titles (cons title aliases))) (all-titles (cons title aliases)))
(mapcar (lambda (temp-title) (mapcar (lambda (temp-title)
@ -887,7 +889,8 @@ node."
;;;###autoload ;;;###autoload
(defun org-roam-refile (node) (defun org-roam-refile (node)
"Refile node at point to an Org-roam node. "Refile node at point to an org-roam NODE.
If region is active, then use it instead of the node at point." If region is active, then use it instead of the node at point."
(interactive (interactive
(list (org-roam-node-read nil nil nil 'require-match))) (list (org-roam-node-read nil nil nil 'require-match)))

View File

@ -186,11 +186,12 @@ By default, `executable-find' will be used to look up the path to
the executable. If a custom path is required, it can be specified the executable. If a custom path is required, it can be specified
together with the method symbol as a cons cell. For example: together with the method symbol as a cons cell. For example:
'(find (rg . \"/path/to/rg\"))." '(find (rg . \"/path/to/rg\"))."
:type '(set (const :tag "find" find) :type '(set
(const :tag "fd" fd) (const :tag "find" find)
(const :tag "fdfind" fdfind) (const :tag "fd" fd)
(const :tag "rg" rg) (const :tag "fdfind" fdfind)
(const :tag "elisp" nil))) (const :tag "rg" rg)
(const :tag "elisp" nil)))
;;; Library ;;; Library
(defun org-roam-file-p (&optional file) (defun org-roam-file-p (&optional file)
@ -322,8 +323,9 @@ E.g. (\".org\") => (\"*.org\" \"*.org.gpg\")"
(defun org-roam--list-files-rg (executable dir) (defun org-roam--list-files-rg (executable dir)
"Return all Org-roam files under DIR, using \"rg\", provided as EXECUTABLE." "Return all Org-roam files under DIR, using \"rg\", provided as EXECUTABLE."
(let* ((globs (org-roam--list-files-search-globs org-roam-file-extensions)) (let* ((globs (org-roam--list-files-search-globs org-roam-file-extensions))
(command (string-join `(,executable "-L" ,dir "--files" (command (string-join `(
,@(mapcar (lambda (glob) (concat "-g " glob)) globs)) " "))) ,executable "-L" ,dir "--files"
,@(mapcar (lambda (glob) (concat "-g " glob)) globs)) " ")))
(org-roam--shell-command-files command))) (org-roam--shell-command-files command)))
(declare-function org-roam--directory-files-recursively "org-roam-compat") (declare-function org-roam--directory-files-recursively "org-roam-compat")