[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Org-cite follow function for ebib
From: |
Thomas S. Dye |
Subject: |
Re: Org-cite follow function for ebib |
Date: |
Sat, 07 Aug 2021 13:15:25 -1000 |
User-agent: |
mu4e 1.4.15; emacs 27.1 |
Aloha Joost,
Following some pointers from Eric and Bruce I have this in my
configuration and it seems to work fine, though I haven't had a chance
to use it very much.
;; Citations
(defun tsd/choose-file (candidates)
(interactive)
(org-completing-read "Choose file: " candidates))
(defun tsd/ebib-follow (datum _)
"Follow citation or citation reference DATUM. When DATUM is a
citation reference, open ebib to the entry referencing the
citation key."
(let* ((key
(if (eq 'citation-reference (org-element-type datum))
(org-element-property :key datum)
(user-error "Not a citation reference")))
(files (org-cite-list-bibliography-files))
(file (if (> (length files) 1)
(tsd/choose-file files)
(nth 0 files))))
(ebib file key)))
(require 'oc-biblatex)
(require 'oc-csl)
(org-cite-register-processor 'ebib
:follow #'tsd/ebib-follow)
(setq org-cite-follow-processor 'ebib)
Also, it was easy to configure ebib to insert citations with the
org-cite syntax.
All the best,
Tom
Joost Kremers <joostkremers@fastmail.fm> writes:
> On Fri, Aug 06 2021, Thomas S. Dye wrote:
>> Yes, I have set the basic follow processor and org-open-at-point takes
>> me to the .bib file at the entry for the key at point.
>
> Unfortunately, I haven't had the time yet to update Ebib for the new
> functionality. Ebib needs to implement a follow processor so that
> `org-open-at-point` takes you to the entry in Ebib.
>
>> Surprisingly (to me), M-x ebib sometimes displays the entry for the key
>> at point, too.
>
> That's because when you start Ebib with `M-x ebib` (or a key bound to that
> function, of course), it checks to see if point is at something that looks
> like
> a key and tries to find a corresponding entry in the current database. That
> functionality is not customisable and not very well implemented, so it doesn't
> always work. (Also, if point is at the `cite` prefix, it doesn't work.)
--
Thomas S. Dye
https://tsdye.online/tsdye
- Org-cite follow function for ebib, Thomas S. Dye, 2021/08/05
- Re: Org-cite follow function for ebib, Bruce D'Arcus, 2021/08/05
- Re: Org-cite follow function for ebib, Thomas S. Dye, 2021/08/05
- Re: Org-cite follow function for ebib, Eric S Fraga, 2021/08/06
- Re: Org-cite follow function for ebib, Thomas S. Dye, 2021/08/06
- Re: Org-cite follow function for ebib, Bruce D'Arcus, 2021/08/06
- Re: Org-cite follow function for ebib, Thomas S. Dye, 2021/08/06
- Re: Org-cite follow function for ebib, Bruce D'Arcus, 2021/08/06
- Re: Org-cite follow function for ebib, Thomas S. Dye, 2021/08/06
- Re: Org-cite follow function for ebib, Joost Kremers, 2021/08/07
- Re: Org-cite follow function for ebib,
Thomas S. Dye <=
- Re: Org-cite follow function for ebib, Joost Kremers, 2021/08/09
- Re: Org-cite follow function for ebib, Bruce D'Arcus, 2021/08/09
- Re: Org-cite follow function for ebib, John Kitchin, 2021/08/09
- Re: Org-cite follow function for ebib, Thomas S. Dye, 2021/08/09