all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Org-cite follow function for ebib
@ 2021-08-05 18:37 Thomas S. Dye
  2021-08-05 19:10 ` Bruce D'Arcus
  0 siblings, 1 reply; 15+ messages in thread
From: Thomas S. Dye @ 2021-08-05 18:37 UTC (permalink / raw)
  To: Org Mode List

Aloha all,

My googling came up empty.  Does anyone have such a function?

All the best,
Tom
--
Thomas S. Dye
https://tsdye.online/tsdye


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Org-cite follow function for ebib
  2021-08-05 18:37 Org-cite follow function for ebib Thomas S. Dye
@ 2021-08-05 19:10 ` Bruce D'Arcus
  2021-08-05 20:12   ` Thomas S. Dye
  0 siblings, 1 reply; 15+ messages in thread
From: Bruce D'Arcus @ 2021-08-05 19:10 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Org Mode List

What kind of functionality do you want associated with your citations
(when you run `org-open-at-point` on them)?

Is some or all of it specific to ebib?

Or is it more generic; opening the bib entry, notes, PDFs, etc?

Because the modular nature of org-cite makes it easy to mix-and-match
pieces from different projects.

For example, bibtex-actions offers an embark-based follow processor,
that uses bibtex-completion behind-the-scenes, and org-ref-cite does
similar for a hydra.

On Thu, Aug 5, 2021 at 2:38 PM Thomas S. Dye <tsd@tsdye.online> wrote:
>
> Aloha all,
>
> My googling came up empty.  Does anyone have such a function?
>
> All the best,
> Tom
> --
> Thomas S. Dye
> https://tsdye.online/tsdye
>


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Org-cite follow function for ebib
  2021-08-05 19:10 ` Bruce D'Arcus
@ 2021-08-05 20:12   ` Thomas S. Dye
  2021-08-06  7:48     ` Eric S Fraga
  0 siblings, 1 reply; 15+ messages in thread
From: Thomas S. Dye @ 2021-08-05 20:12 UTC (permalink / raw)
  To: Bruce D'Arcus; +Cc: Org Mode List

I want to open the bib entry, something similar to org-ebib-open, 
which works on Org mode links.

All the best,
Tom

Bruce D'Arcus <bdarcus@gmail.com> writes:

> What kind of functionality do you want associated with your 
> citations
> (when you run `org-open-at-point` on them)?
>
> Is some or all of it specific to ebib?
>
> Or is it more generic; opening the bib entry, notes, PDFs, etc?
>
> Because the modular nature of org-cite makes it easy to 
> mix-and-match
> pieces from different projects.
>
> For example, bibtex-actions offers an embark-based follow 
> processor,
> that uses bibtex-completion behind-the-scenes, and org-ref-cite 
> does
> similar for a hydra.
>
> On Thu, Aug 5, 2021 at 2:38 PM Thomas S. Dye <tsd@tsdye.online> 
> wrote:
>>
>> Aloha all,
>>
>> My googling came up empty.  Does anyone have such a function?
>>
>> All the best,
>> Tom
>> --
>> Thomas S. Dye
>> https://tsdye.online/tsdye
>>


--
Thomas S. Dye
https://tsdye.online/tsdye


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Org-cite follow function for ebib
  2021-08-05 20:12   ` Thomas S. Dye
@ 2021-08-06  7:48     ` Eric S Fraga
  2021-08-06 15:49       ` Thomas S. Dye
  0 siblings, 1 reply; 15+ messages in thread
From: Eric S Fraga @ 2021-08-06  7:48 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Org Mode List, Bruce D'Arcus

On Thursday,  5 Aug 2021 at 10:12, Thomas S. Dye wrote:
> I want to open the bib entry, something similar to org-ebib-open,
> which works on Org mode links.

Tom,

maybe clarify what org-ebib-open does?

For me, org-open-at-point, bound to C-c C-o, on a [cite:@key] entry,
will open the bibliography file and place me at the correct entry.  What
is it you want to do beyond this?

(I have not used ebib in years and have forgotten what it is it might
do.)

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.4.6-607-g185706
: Latest paper written in org: https://arxiv.org/abs/2106.05096


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Org-cite follow function for ebib
  2021-08-06  7:48     ` Eric S Fraga
@ 2021-08-06 15:49       ` Thomas S. Dye
  2021-08-06 15:59         ` Bruce D'Arcus
  0 siblings, 1 reply; 15+ messages in thread
From: Thomas S. Dye @ 2021-08-06 15:49 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: Org Mode List, Bruce D'Arcus

Aloha Eric,

That function opens a window on the ebib database and displays the
record with the key at point.

At this point, I'm just checking to see if someone has a similar
function working for the new org-cite framework.

I do appreciate the pointers to functions that do something similar
outside ebib.  They'll be useful if I try to write a function myself.

All the best,
Tom

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> On Thursday,  5 Aug 2021 at 10:12, Thomas S. Dye wrote:
>> I want to open the bib entry, something similar to org-ebib-open,
>> which works on Org mode links.
>
> Tom,
>
> maybe clarify what org-ebib-open does?
>
> For me, org-open-at-point, bound to C-c C-o, on a [cite:@key] entry,
> will open the bibliography file and place me at the correct entry.  What
> is it you want to do beyond this?
>
> (I have not used ebib in years and have forgotten what it is it might
> do.)


--
Thomas S. Dye
https://tsdye.online/tsdye


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Org-cite follow function for ebib
  2021-08-06 15:49       ` Thomas S. Dye
@ 2021-08-06 15:59         ` Bruce D'Arcus
  2021-08-06 16:47           ` Thomas S. Dye
  0 siblings, 1 reply; 15+ messages in thread
From: Bruce D'Arcus @ 2021-08-06 15:59 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Org Mode List, Eric S Fraga

On Fri, Aug 6, 2021 at 11:50 AM Thomas S. Dye <tsd@tsdye.online> wrote:
>
> Aloha Eric,
>
> That function opens a window on the ebib database and displays the
> record with the key at point.

So does the oc-basic follow function not provide this?

I guess I'm unclear if one can configure ebib to open bib files by
default. If yes, I would think oc-basic would be sufficient.

If not, FWIW, org-ref-cite-follow is extensible via hydra+ (as is
bibtex-actions-follow via a custom embark keymap).

Depends if you want just a single function to run, or you want a menu
of choices.

Bruce


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Org-cite follow function for ebib
  2021-08-06 15:59         ` Bruce D'Arcus
@ 2021-08-06 16:47           ` Thomas S. Dye
  2021-08-06 16:55             ` Bruce D'Arcus
  0 siblings, 1 reply; 15+ messages in thread
From: Thomas S. Dye @ 2021-08-06 16:47 UTC (permalink / raw)
  To: Bruce D'Arcus; +Cc: Org Mode List, Eric S Fraga

Aloha Bruce,

So, I tried calling ebib() with point on a key and it works in some
instances but not in others.

So far, it works sometimes on plain cite: keys, but never on styles or
variants, like cite/a/f:

It would be magical if something this simple would do the trick.

All the best,
Tom

Bruce D'Arcus <bdarcus@gmail.com> writes:

> On Fri, Aug 6, 2021 at 11:50 AM Thomas S. Dye <tsd@tsdye.online> wrote:
>>
>> Aloha Eric,
>>
>> That function opens a window on the ebib database and displays the
>> record with the key at point.
>
> So does the oc-basic follow function not provide this?
>
> I guess I'm unclear if one can configure ebib to open bib files by
> default. If yes, I would think oc-basic would be sufficient.
>
> If not, FWIW, org-ref-cite-follow is extensible via hydra+ (as is
> bibtex-actions-follow via a custom embark keymap).
>
> Depends if you want just a single function to run, or you want a menu
> of choices.
>
> Bruce


--
Thomas S. Dye
https://tsdye.online/tsdye


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Org-cite follow function for ebib
  2021-08-06 16:47           ` Thomas S. Dye
@ 2021-08-06 16:55             ` Bruce D'Arcus
  2021-08-06 17:19               ` Thomas S. Dye
  0 siblings, 1 reply; 15+ messages in thread
From: Bruce D'Arcus @ 2021-08-06 16:55 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Org Mode List, Eric S Fraga

On Fri, Aug 6, 2021 at 12:47 PM Thomas S. Dye <tsd@tsdye.online> wrote:
>
> Aloha Bruce,
>
> So, I tried calling ebib() with point on a key and it works in some
> instances but not in others.

Just to make sure I'm being clear, I mean this in your config:

(setq org-cite-follow-processor 'basic)

... and then, when point is on citation and/or key:

M-x org-open-at-point

... which is what calls the follow processor.

If that doesn't work, you can probably look at the oc-basic code and
see how to adapt it for ebib.

Bruce


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Org-cite follow function for ebib
  2021-08-06 16:55             ` Bruce D'Arcus
@ 2021-08-06 17:19               ` Thomas S. Dye
  2021-08-07 20:57                 ` Joost Kremers
  0 siblings, 1 reply; 15+ messages in thread
From: Thomas S. Dye @ 2021-08-06 17:19 UTC (permalink / raw)
  To: Bruce D'Arcus; +Cc: Org Mode List, Eric S Fraga

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.

Surprisingly (to me), M-x ebib sometimes displays the entry for the key
at point, too.

All the best,
Tom

Bruce D'Arcus <bdarcus@gmail.com> writes:

> On Fri, Aug 6, 2021 at 12:47 PM Thomas S. Dye <tsd@tsdye.online> wrote:
>>
>> Aloha Bruce,
>>
>> So, I tried calling ebib() with point on a key and it works in some
>> instances but not in others.
>
> Just to make sure I'm being clear, I mean this in your config:
>
> (setq org-cite-follow-processor 'basic)
>
> ... and then, when point is on citation and/or key:
>
> M-x org-open-at-point
>
> ... which is what calls the follow processor.
>
> If that doesn't work, you can probably look at the oc-basic code and
> see how to adapt it for ebib.
>
> Bruce


--
Thomas S. Dye
https://tsdye.online/tsdye


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Org-cite follow function for ebib
  2021-08-06 17:19               ` Thomas S. Dye
@ 2021-08-07 20:57                 ` Joost Kremers
  2021-08-07 23:15                   ` Thomas S. Dye
  0 siblings, 1 reply; 15+ messages in thread
From: Joost Kremers @ 2021-08-07 20:57 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: emacs-orgmode, Bruce D'Arcus, Eric S Fraga


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.)

-- 
Joost Kremers
Life has its moments


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Org-cite follow function for ebib
  2021-08-07 20:57                 ` Joost Kremers
@ 2021-08-07 23:15                   ` Thomas S. Dye
  2021-08-09 10:35                     ` Joost Kremers
  0 siblings, 1 reply; 15+ messages in thread
From: Thomas S. Dye @ 2021-08-07 23:15 UTC (permalink / raw)
  To: Joost Kremers; +Cc: emacs-orgmode, Bruce D'Arcus, Eric S Fraga

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


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Org-cite follow function for ebib
  2021-08-07 23:15                   ` Thomas S. Dye
@ 2021-08-09 10:35                     ` Joost Kremers
  2021-08-09 12:05                       ` Bruce D'Arcus
  2021-08-09 12:38                       ` John Kitchin
  0 siblings, 2 replies; 15+ messages in thread
From: Joost Kremers @ 2021-08-09 10:35 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: emacs-orgmode, Bruce D'Arcus, Eric S Fraga

Hi Thomas & others,

On Sat, Aug 07 2021, Thomas S. Dye wrote:
> 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.

Thanks for figuring that out. :-) Once I get to implementing support, I'll use
it as a starting point. There should also be a way to open the correct file
automatically, without the user having to select it.



-- 
Joost Kremers
Life has its moments


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Org-cite follow function for ebib
  2021-08-09 10:35                     ` Joost Kremers
@ 2021-08-09 12:05                       ` Bruce D'Arcus
  2021-08-09 12:38                       ` John Kitchin
  1 sibling, 0 replies; 15+ messages in thread
From: Bruce D'Arcus @ 2021-08-09 12:05 UTC (permalink / raw)
  To: Joost Kremers; +Cc: org-mode-email, Eric S Fraga

I don't have a super specific suggestion ATM, but will just make the
following observation:

John Kitchin and I have been working on respective processors, and
they are modular enough that:

1) one can mix-and-match across projects

2) one can customize within each follow processor; for org-ref-cite,
you can extend its hydra-based follow UI using hydra+, and for
bibtex-actions you can write and use your own keymap to tell embark
which commands to use for it's menu.

Upshot: a function that takes a key (or list of keys, as with
bibtex-completion, which is what I use behind-the-scenes) is the
starting point for a basic single action follow processor. But it
should be easily incorporated into more feature-full UIs.



On Mon, Aug 9, 2021 at 6:45 AM Joost Kremers <joostkremers@fastmail.fm> wrote:
>
> Hi Thomas & others,
>
> On Sat, Aug 07 2021, Thomas S. Dye wrote:
> > 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.
>
> Thanks for figuring that out. :-) Once I get to implementing support, I'll use
> it as a starting point. There should also be a way to open the correct file
> automatically, without the user having to select it.
>
>
>
> --
> Joost Kremers
> Life has its moments


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Org-cite follow function for ebib
  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
  1 sibling, 1 reply; 15+ messages in thread
From: John Kitchin @ 2021-08-09 12:38 UTC (permalink / raw)
  To: Joost Kremers; +Cc: Bruce D'Arcus, org-mode-email, Eric S Fraga

[-- Attachment #1: Type: text/plain, Size: 1137 bytes --]

If every thing is working right, you can get the file that a key is in like
this:

#+BEGIN_SRC emacs-lisp
(cl-loop for (file . entries) in (org-cite-basic--parse-bibliography)
when (gethash  "some-key" entries)
         return file)
#+END_SRC

This returns the first file that matches.

John

-----------------------------------
Professor John Kitchin (he/him/his)
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Mon, Aug 9, 2021 at 6:45 AM Joost Kremers <joostkremers@fastmail.fm>
wrote:

> Hi Thomas & others,
>
> On Sat, Aug 07 2021, Thomas S. Dye wrote:
> > 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.
>
> Thanks for figuring that out. :-) Once I get to implementing support, I'll
> use
> it as a starting point. There should also be a way to open the correct file
> automatically, without the user having to select it.
>
>
>
> --
> Joost Kremers
> Life has its moments
>
>

[-- Attachment #2: Type: text/html, Size: 1874 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Org-cite follow function for ebib
  2021-08-09 12:38                       ` John Kitchin
@ 2021-08-09 16:14                         ` Thomas S. Dye
  0 siblings, 0 replies; 15+ messages in thread
From: Thomas S. Dye @ 2021-08-09 16:14 UTC (permalink / raw)
  To: John Kitchin
  Cc: Joost Kremers, Bruce D'Arcus, org-mode-email, Eric S Fraga

Aloha John,

Thanks!

All the best,
Tom

John Kitchin <jkitchin@andrew.cmu.edu> writes:

> If every thing is working right, you can get the file that a key is in like
> this:
>
> #+BEGIN_SRC emacs-lisp
> (cl-loop for (file . entries) in (org-cite-basic--parse-bibliography)
> when (gethash  "some-key" entries)
>          return file)
> #+END_SRC
>
> This returns the first file that matches.
>
> John
>
> -----------------------------------
> Professor John Kitchin (he/him/his)
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
>
>
> On Mon, Aug 9, 2021 at 6:45 AM Joost Kremers <joostkremers@fastmail.fm>
> wrote:
>
>> Hi Thomas & others,
>>
>> On Sat, Aug 07 2021, Thomas S. Dye wrote:
>> > 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.
>>
>> Thanks for figuring that out. :-) Once I get to implementing support, I'll
>> use
>> it as a starting point. There should also be a way to open the correct file
>> automatically, without the user having to select it.
>>
>>
>>
>> --
>> Joost Kremers
>> Life has its moments
>>
>>


--
Thomas S. Dye
https://tsdye.online/tsdye


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-08-09 16:17 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-05 18:37 Org-cite follow function for ebib 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
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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.