mirror of
https://github.com/org-roam/org-roam
synced 2025-09-28 16:50:58 -05:00
(fix): don't print no citelinks if org-ref is not present (#714)
Change confusing behaviour where org-roam buffer prints "no citelinks" even when org-ref is not present.
This commit is contained in:
@@ -116,10 +116,10 @@ When non-nil, the window will not be closed when deleting other windows."
|
|||||||
|
|
||||||
(defun org-roam-buffer--insert-citelinks ()
|
(defun org-roam-buffer--insert-citelinks ()
|
||||||
"Insert citation backlinks for the current buffer."
|
"Insert citation backlinks for the current buffer."
|
||||||
|
(when (require 'org-ref nil t) ;; Ensure that org-ref is present
|
||||||
(if-let* ((ref (with-temp-buffer
|
(if-let* ((ref (with-temp-buffer
|
||||||
(insert-buffer-substring org-roam-buffer--current)
|
(insert-buffer-substring org-roam-buffer--current)
|
||||||
(org-roam--extract-ref)))
|
(org-roam--extract-ref)))
|
||||||
(org-ref-p (require 'org-ref nil t)) ; Ensure that org-ref is present
|
|
||||||
(key-backlinks (org-roam--get-backlinks (cdr ref)))
|
(key-backlinks (org-roam--get-backlinks (cdr ref)))
|
||||||
(grouped-backlinks (--group-by (nth 0 it) key-backlinks)))
|
(grouped-backlinks (--group-by (nth 0 it) key-backlinks)))
|
||||||
(progn
|
(progn
|
||||||
@@ -141,7 +141,7 @@ When non-nil, the window will not be closed when deleting other windows."
|
|||||||
'file-from file-from
|
'file-from file-from
|
||||||
'file-from-point (plist-get props :point)))
|
'file-from-point (plist-get props :point)))
|
||||||
(insert "\n\n"))))))
|
(insert "\n\n"))))))
|
||||||
(insert "\n\n* No cite backlinks!")))
|
(insert "\n\n* No cite backlinks!"))))
|
||||||
|
|
||||||
(defun org-roam-buffer--insert-backlinks ()
|
(defun org-roam-buffer--insert-backlinks ()
|
||||||
"Insert the org-roam-buffer backlinks string for the current buffer."
|
"Insert the org-roam-buffer backlinks string for the current buffer."
|
||||||
|
Reference in New Issue
Block a user