Closed randomwangran closed 1 year ago
There is a function in org-ref-citation-link.el
:
(defun org-ref-jump-to-visible-key ()
"Jump to a visible key with avy."
(interactive)
(avy-with avy-goto-key
(avy-process
(apply #'append
(save-excursion
(org-element-map (org-element-parse-buffer) 'link
(lambda (c)
(when (assoc (org-element-property :type c) org-ref-cite-types)
(goto-char (org-element-property :begin c))
(let* ((path (org-element-property :path c))
(data (org-ref-parse-cite-path path))
(references (plist-get data :references)))
(append (list (org-element-property :begin c))
(cl-loop for ref in references collect
(progn
(search-forward (plist-get ref :key))
(match-beginning 0)))))))))))
(avy--style-fn avy-style)))
So, the user can have finner control over the Dropping Zone (DZ).
If the citation has a format like this:
link-hint-open-link
can only identify the =citation= as one link.However, if the cursor is on a different key, the open command will result in different things.
Condition 1:![image](https://user-images.githubusercontent.com/8197831/160199756-9ac8ba1c-cdb1-4718-87c8-b58c8b70ca75.png)
Will open
feynman2011feynman
.Condition 2:![image](https://user-images.githubusercontent.com/8197831/160199789-a0d98f82-ac7d-43f4-982b-eb02eadfa437.png)
Will open
hutchings2018surely
.org-ref-next-key
can identify the links in a finner level, so that would be a good starting point.