org-roam / org-roam-bibtex

Org Roam integration with bibliography management software
GNU General Public License v3.0
572 stars 47 forks source link

Note actions: optionally look up cite key in parent hierarchy #270

Open adql opened 1 year ago

adql commented 1 year ago

Is your feature request related to a problem? Please describe. It's probably a very common practice to have child nodes under a (typically file-level) parent node with a citation key (i.e. make various literature notes to the same source "first-class" org-roam nodes). This makes calling orb-note-actions with point within a child node useless, forcing the user to temporarily move point to the relevant parent node.

Describe the solution you'd like Add an option variable e.g. orb-look-up-cite-key-in-parents. When set, use the nearest parent node with a cite key for calling orb-note-actions.

Describe alternatives you've considered I've advised orb-note-actions to move point to (point-min):

(defun my/eval-with-point-at-min (f &rest args)
  (org-with-wide-buffer
   (save-excursion
     (goto-char (point-min))
     (apply f args))))
(advice-add 'orb-note-actions :around 'my/eval-with-point-at-min)

This solution is limited to the case where the file-level node holds the cite key (which is likely the most common use case). It suffers the annoyance that, when opening the PDF within Emacs, the point stays at the buffer's beginning (unless it has been narrowed).

Additional context Org Roam BibTeX v. 0.6.1 GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.36, cairo version 1.17.6) of 2023-01-03

myshevchuk commented 1 year ago

Hi @adql, thank you for your request. Although I've personally haven't encountered this problem because I don't use node hierarchy, I can imagine this may be a more or less common situation. Unfortunately, I'm quite busy right now and can't tell when the enhancement you are requesting may be implemented.

adql commented 1 year ago

@myshevchuk Thanks, I'll see if I can work in it myself.