Closed LorenRiccie closed 1 year ago
I think you should be able to edit the wiki if you like ;-)
You are aware that we split the embark functionality into a separate package awhile back; citar-embark
? See here etc
Not so confident, to edit the wiki :)
Do you think this is well coded enough ? It works on my end.
(defun bibtex-key-embark ()
(save-excursion
(bibtex-beginning-of-entry)
(when (looking-at bibtex-entry-maybe-empty-head)
(cons 'bibtex-key
(bibtex-key-in-head)))))
(with-eval-after-load "embark"
(add-to-list 'embark-target-finders 'bibtex-key-embark))
(with-eval-after-load "citar-embark"
(defvar-keymap bibtex-key-embark-map
:doc "Embark keymap"
:parent citar-embark-bibtex-map
"f" #'citar-open
"n" #'citar-open-notes)
(add-to-list 'embark-keymap-alist '(bibtex-key . bibtex-key-embark-map)))
It's been awhile since I've worked with the details of embark code, and it's changed since then, so I'm not certain without digging into it and testing it myself.
I may do that sometime soon (in part because it may suggest an enhancement to citar-embark
), but for now, the obvious question: does it work for you?
If yes, then it's a useful contribution to the wiki ;-)
It works indeed. I will then contribute. Thank you for the encouragement.
Please check https://github.com/emacs-citar/citar/wiki/Citar-in-bibtex-files-with-Embark for an update to use citar-embark actions in a .bibtex file
embark-define-keymap
has been removed from embark package In the citar wiki, the snippet under the section "Using citar in Bibtex files with embark" is therefore not working anymore.In place of I used to make it work the method you normally use to define keymaps:
(with-eval-after-load "embark" (defvar-keymap bibtex-key-embark-map :doc "Embark keymap" :parent embark-file-map "f" #'citar-open "n" #'citar-open-notes) (add-to-list 'embark-keymap-alist '(bibtex-key . bibtex-key-embark-map)))
I dont know if it is the best way to do it, but it works so far.
Since I removed helm-bibtex from my emacs configuration, I really missed the possibility to open file attchments from my bibliographic file and not only from a text citation. Correcting the wiki will maybe help others with an identical workflow.