Generate cite backlinks using all org ref cite types (#551)
This would fail on pathological cases where the key itself contains other prefixes e.g. if the key is `cite:parencite:autocite:key`. Although this is unlikely... To use org-ref-cite-types, we must ensure that org-ref is loaded. This would likely already be done otherwise as the user is obviously using cite links.
This commit is contained in:
parent
0132546e56
commit
e698ed7f53
1 changed files with 5 additions and 1 deletions
|
@ -115,7 +115,11 @@ When non-nil, the window will not be closed when deleting other windows."
|
|||
(if-let* ((roam-key (with-temp-buffer
|
||||
(insert-buffer-substring org-roam-buffer--current)
|
||||
(org-roam--extract-ref)))
|
||||
(key-backlinks (org-roam--get-backlinks (s-chop-prefix "cite:" roam-key)))
|
||||
(org-ref-p (require 'org-ref nil t)) ; Ensure that org-ref is present
|
||||
(cite-prefixes (-map (lambda (type)
|
||||
(concat type ":")) org-ref-cite-types))
|
||||
(key-backlinks (org-roam--get-backlinks
|
||||
(s-chop-prefixes cite-prefixes roam-key)))
|
||||
(grouped-backlinks (--group-by (nth 0 it) key-backlinks)))
|
||||
(progn
|
||||
(insert (let ((l (length key-backlinks)))
|
||||
|
|
Loading…
Reference in a new issue