When I capture a web page using org-protocol to quickly annotate web
pages the file names can be very long, and I rarely
want to keep the same page title as the web page, at any rate. After
annotating my file I can run this function,
cce/org-roam-rename-file interactively and it
will offer a list of titles, including the ROAMALIAS keyword
entries, or rename it if there is only one.
provide 'cce/org-roam-rename-file) (defun cce/org-roam-rename-file (file) ( (interactivelist (if (org-roam-file-p) ( (buffer-file-name)"File: " (ivy--sorted-files org-roam-directory))))) (ivy-read let ((destination ("/" (concat org-roam-directory (org-roam--title-to-sluglet ((titles (org-roam-db--get-titles file))) (if (> (length titles) 1) ("Rename to Which title?" titles) (ivy-read car titles)))) (".org"))) rename-file file destination))) (