emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] oc-bibtex.el: add :follow property from oc-basic
@ 2021-10-21 14:28 Eric S Fraga
  2021-10-21 15:27 ` Bruce D'Arcus
  0 siblings, 1 reply; 6+ messages in thread
From: Eric S Fraga @ 2021-10-21 14:28 UTC (permalink / raw)
  To: Emacs Org mode mailing list

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

Hello all,

I may be violating some coding convention but the attached patch re-uses
the org-cite-basic-goto function from the basic org-cite processor to
implement the follow directive for the bibtex processor.  Seemed like an
obvious win...

Seems to work just fine for me.  I do wonder: should I somehow declare
the function that is being used in oc-bibtex.el given that it is defined
in oc-basic.el?  (my lack of elisp-foo showing here)

Thank you,
eric

-- 
: Eric S Fraga via Emacs 28.0.60, Org release_9.5-149-g781080
: Latest paper written in org: https://arxiv.org/abs/2106.05096

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-oc-bibtex.el-add-follow-property-from-oc-basic.patch --]
[-- Type: text/x-diff, Size: 860 bytes --]

From 297213bcff8f7f743ab0ce36f940d28385e6eb0f Mon Sep 17 00:00:00 2001
From: Eric S Fraga <e.fraga@ucl.ac.uk>
Date: Thu, 21 Oct 2021 15:20:43 +0100
Subject: [PATCH] oc-bibtex.el: add :follow property from oc-basic

* oc-bibtex.el (org-cite-register-processor): Specify the function for
the follow directive as the function defined for the basic org-cite
processor.
---
 lisp/oc-bibtex.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/oc-bibtex.el b/lisp/oc-bibtex.el
index 52dfa0fca..866c51c15 100644
--- a/lisp/oc-bibtex.el
+++ b/lisp/oc-bibtex.el
@@ -79,6 +79,7 @@ state, as a property list."
 (org-cite-register-processor 'bibtex
   :export-bibliography #'org-cite-bibtex-export-bibliography
   :export-citation #'org-cite-bibtex-export-citation
+  :follow #'org-cite-basic-goto
   :cite-styles
   '((("nocite" "n"))
     (("nil"))))
-- 
2.30.2


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

* Re: [PATCH] oc-bibtex.el: add :follow property from oc-basic
  2021-10-21 14:28 [PATCH] oc-bibtex.el: add :follow property from oc-basic Eric S Fraga
@ 2021-10-21 15:27 ` Bruce D'Arcus
  2021-10-21 15:58   ` Eric S Fraga
  0 siblings, 1 reply; 6+ messages in thread
From: Bruce D'Arcus @ 2021-10-21 15:27 UTC (permalink / raw)
  To: Org Mode List

On Thu, Oct 21, 2021 at 10:29 AM Eric S Fraga <e.fraga@ucl.ac.uk> wrote:
>
> Hello all,
>
> I may be violating some coding convention but the attached patch re-uses
> the org-cite-basic-goto function from the basic org-cite processor to
> implement the follow directive for the bibtex processor.  Seemed like an
> obvious win...

Maybe I'm missing something, but why is that necessary?

Processors can be mixed and matched; it's all modular.

So you can already use the basic follow processor with the bibtex
export processor.

Bruce


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

* Re: [PATCH] oc-bibtex.el: add :follow property from oc-basic
  2021-10-21 15:27 ` Bruce D'Arcus
@ 2021-10-21 15:58   ` Eric S Fraga
  2021-10-21 16:18     ` Bruce D'Arcus
  0 siblings, 1 reply; 6+ messages in thread
From: Eric S Fraga @ 2021-10-21 15:58 UTC (permalink / raw)
  To: Bruce D'Arcus; +Cc: Org Mode List

Hi Bruce,

thank you for the quick response.

On Thursday, 21 Oct 2021 at 11:27, Bruce D'Arcus wrote:
> Maybe I'm missing something, but why is that necessary?

It's highly likely that I am missing something (not a rare occurence
;-)) but, out of the box without explicitly specifying a follow
function, the default behaviour is not well-defined?  At least, C-c C-o
doesn't work as I would expect.  It seems a reasonable expectation to
have a default that works out of the box?

-- 
: Eric S Fraga via Emacs 28.0.60, Org release_9.5-149-g781080
: Latest paper written in org: https://arxiv.org/abs/2106.05096


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

* Re: [PATCH] oc-bibtex.el: add :follow property from oc-basic
  2021-10-21 15:58   ` Eric S Fraga
@ 2021-10-21 16:18     ` Bruce D'Arcus
  2021-10-21 16:27       ` Eric S Fraga
  2021-10-21 16:50       ` Eric S Fraga
  0 siblings, 2 replies; 6+ messages in thread
From: Bruce D'Arcus @ 2021-10-21 16:18 UTC (permalink / raw)
  To: Org Mode List

On Thu, Oct 21, 2021 at 11:58 AM Eric S Fraga <e.fraga@ucl.ac.uk> wrote:
>
> Hi Bruce,
>
> thank you for the quick response.
>
> On Thursday, 21 Oct 2021 at 11:27, Bruce D'Arcus wrote:
> > Maybe I'm missing something, but why is that necessary?
>
> It's highly likely that I am missing something (not a rare occurence
> ;-)) but, out of the box without explicitly specifying a follow
> function, the default behaviour is not well-defined?  At least, C-c C-o
> doesn't work as I would expect.  It seems a reasonable expectation to
> have a default that works out of the box?

Yes.

But the default org-cite-follow-processor is "basic", so it should now
work "out of the box". If for some reason it isn't, maybe there's an
issue there?

Just to be clear what I was meaning by the modularity, you could do
this if you wanted:

(setq org-cite-insert-processor 'oc-bibtex-actions
         org-cite-follow-processor 'basic
         org-cite-activate-processor 'org-ref-cite
         org-cite-export-processors '((latex bibtex)))

Bruce


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

* Re: [PATCH] oc-bibtex.el: add :follow property from oc-basic
  2021-10-21 16:18     ` Bruce D'Arcus
@ 2021-10-21 16:27       ` Eric S Fraga
  2021-10-21 16:50       ` Eric S Fraga
  1 sibling, 0 replies; 6+ messages in thread
From: Eric S Fraga @ 2021-10-21 16:27 UTC (permalink / raw)
  To: Bruce D'Arcus; +Cc: Org Mode List

On Thursday, 21 Oct 2021 at 12:18, Bruce D'Arcus wrote:
> But the default org-cite-follow-processor is "basic", so it should now
> work "out of the box". If for some reason it isn't, maybe there's an
> issue there?

Okay, I do have that variable set to basic so there must be something
else wrong in my configuration.  I know that C-c C-o was not jumping to
my bib file but I don't know why.  I will explore and report
back.  Ignore my patch!

> Just to be clear what I was meaning by the modularity, you could do
> this if you wanted:

Yes, I think I understood this.

I'm trying to keep my configuration as simple as possible, something
that should be easy as all I want is simple bibtex citations in LaTeX
export.

thank you,
eric

-- 
: Eric S Fraga via Emacs 28.0.60, Org release_9.5-149-g781080
: Latest paper written in org: https://arxiv.org/abs/2106.05096


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

* Re: [PATCH] oc-bibtex.el: add :follow property from oc-basic
  2021-10-21 16:18     ` Bruce D'Arcus
  2021-10-21 16:27       ` Eric S Fraga
@ 2021-10-21 16:50       ` Eric S Fraga
  1 sibling, 0 replies; 6+ messages in thread
From: Eric S Fraga @ 2021-10-21 16:50 UTC (permalink / raw)
  To: Bruce D'Arcus; +Cc: Org Mode List

Just to say that I recompiled org and reloaded and following a citation
now works "out of the box".  Caveat: I haven't restarted Emacs (it's my
window manager and hence there's significant inertia against exiting
Emacs...) so I'll verify everything next time I restart (which could be
some time...).

Now back to writing my paper!

Thanks again,
eric

PS - writing academic papers fully in org gets easier all the
     time. org-cite is the latest greatest addition!  Thank you all.
-- 
: Eric S Fraga via Emacs 28.0.60, Org release_9.5-163-g4eab5b
: Latest paper written in org: https://arxiv.org/abs/2106.05096


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

end of thread, other threads:[~2021-10-21 16:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-21 14:28 [PATCH] oc-bibtex.el: add :follow property from oc-basic Eric S Fraga
2021-10-21 15:27 ` Bruce D'Arcus
2021-10-21 15:58   ` Eric S Fraga
2021-10-21 16:18     ` Bruce D'Arcus
2021-10-21 16:27       ` Eric S Fraga
2021-10-21 16:50       ` Eric S Fraga

Code repositories for project(s) associated with this public inbox

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

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