emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Thomas S. Dye" <tsd@tsdye.online>
To: Joost Kremers <joostkremers@fastmail.fm>
Cc: emacs-orgmode@gnu.org, Bruce D'Arcus <bdarcus@gmail.com>,
	Eric S Fraga <e.fraga@ucl.ac.uk>
Subject: Re: Org-cite follow function for ebib
Date: Sat, 07 Aug 2021 13:15:25 -1000	[thread overview]
Message-ID: <87h7g0j182.fsf@tsdye.online> (raw)
In-Reply-To: <87o8a8syoz.fsf@fastmail.fm>

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)
    (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,

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

  reply	other threads:[~2021-08-07 23:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-05 18:37 Thomas S. Dye
2021-08-05 19:10 ` Bruce D'Arcus
2021-08-05 20:12   ` Thomas S. Dye
2021-08-06  7:48     ` Eric S Fraga
2021-08-06 15:49       ` Thomas S. Dye
2021-08-06 15:59         ` Bruce D'Arcus
2021-08-06 16:47           ` Thomas S. Dye
2021-08-06 16:55             ` Bruce D'Arcus
2021-08-06 17:19               ` Thomas S. Dye
2021-08-07 20:57                 ` Joost Kremers
2021-08-07 23:15                   ` Thomas S. Dye [this message]
2021-08-09 10:35                     ` Joost Kremers
2021-08-09 12:05                       ` Bruce D'Arcus
2021-08-09 12:38                       ` John Kitchin
2021-08-09 16:14                         ` Thomas S. Dye

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h7g0j182.fsf@tsdye.online \
    --to=tsd@tsdye.online \
    --cc=bdarcus@gmail.com \
    --cc=e.fraga@ucl.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    --cc=joostkremers@fastmail.fm \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).