diff --git a/bibtex-actions-file.el b/bibtex-actions-file.el index 00afe77e..ffc8a8b3 100644 --- a/bibtex-actions-file.el +++ b/bibtex-actions-file.el @@ -45,7 +45,7 @@ :type '(boolean)) (defcustom bibtex-actions-file-open-note-function - 'bibtex-actions-file-open-notes-default + 'bibtex-actions-file-open-notes-default-org "Function to open and existing or create a new note. If you use 'org-roam' and 'org-roam-bibtex', for example, you can @@ -158,7 +158,7 @@ use 'orb-edit-note' for this value." nil 0 nil file))) -(defun bibtex-actions-file-open-notes-default (key) +(defun bibtex-actions-file-open-notes-default-org (key) "Open a note file from KEY." (if-let* ((file (caar (bibtex-actions-file--files-to-open-or-create @@ -168,12 +168,12 @@ use 'orb-edit-note' for this value." (funcall bibtex-actions-file-open-function file) (let* ((uuid (org-id-new)) (entry (bibtex-actions-get-entry key)) - (note-title + (note-meta (bibtex-actions--format-entry-no-widths entry (bibtex-actions-get-template 'note))) (content - (concat ":PROPERTIES:\n:ID: " uuid "\n:END:\n" note-title "\n"))) + (concat ":PROPERTIES:\n:ID: " uuid "\n:END:\n" note-meta "\n"))) (funcall bibtex-actions-file-open-function file) (insert content)))) diff --git a/bibtex-actions.el b/bibtex-actions.el index f6f1c84a..8ac43c61 100644 --- a/bibtex-actions.el +++ b/bibtex-actions.el @@ -449,13 +449,10 @@ has not yet been created") (defun bibtex-actions-get-entry (key) "Return the cached entry for KEY." - (if (and (eq 'uninitialized bibtex-actions--candidates-cache) - (eq 'uninitialized bibtex-actions--local-candidates-cache)) - (message "Something is wrong; your library is not initialized.") - (cddr (seq-find - (lambda (entry) - (string-equal key (cadr entry))) - (bibtex-actions--get-candidates))))) + (cddr (seq-find + (lambda (entry) + (string-equal key (cadr entry))) + (bibtex-actions--get-candidates)))) (defun bibtex-actions-get-template (template-name) "Return template string for TEMPLATE-NAME." @@ -467,10 +464,10 @@ If the cache is unintialized, this will load the cache. If FORCE-REBUILD-CACHE is t, force reload the cache." (if force-rebuild-cache (bibtex-actions-refresh force-rebuild-cache) - (when (eq 'uninitialized bibtex-actions--candidates-cache) - (bibtex-actions-refresh nil 'global)) - (when (eq 'uninitialized bibtex-actions--local-candidates-cache) - (bibtex-actions-refresh nil 'local))) + (when (eq 'uninitialized bibtex-actions--candidates-cache) + (bibtex-actions-refresh nil 'global)) + (when (eq 'uninitialized bibtex-actions--local-candidates-cache) + (bibtex-actions-refresh nil 'local))) (seq-concatenate 'list bibtex-actions--local-candidates-cache bibtex-actions--candidates-cache))