emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* ivy-bibtex and orgmode inserts ebib: link
@ 2019-03-22 10:39 Eric S Fraga
  2019-03-22 11:10 ` Eric S Fraga
  0 siblings, 1 reply; 8+ messages in thread
From: Eric S Fraga @ 2019-03-22 10:39 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

I have started using ivy-bibtex (wonderful package) but I have one
strange behaviour: when I ask it to insert a citation, it inserts
"ebib:XXXX".  I have searched but cannot see anywhere where I can tell
ivy-bibtex to insert "cite:XXXX" instead.  Does anybody have any
pointers?

Thanks,
eric

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.2.2-324-gd58827

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

* Re: ivy-bibtex and orgmode inserts ebib: link
  2019-03-22 10:39 ivy-bibtex and orgmode inserts ebib: link Eric S Fraga
@ 2019-03-22 11:10 ` Eric S Fraga
  2019-03-22 11:29   ` Eric S Fraga
  0 siblings, 1 reply; 8+ messages in thread
From: Eric S Fraga @ 2019-03-22 11:10 UTC (permalink / raw)
  To: emacs-orgmode

On Friday, 22 Mar 2019 at 10:39, Eric S Fraga wrote:
> Hello,
>
> I have started using ivy-bibtex (wonderful package) but I have one
> strange behaviour: when I ask it to insert a citation, it inserts
> "ebib:XXXX".  I have searched but cannot see anywhere where I can tell
> ivy-bibtex to insert "cite:XXXX" instead.  Does anybody have any
> pointers?

Sigh.  As always, I find the answer *after* asking on the list.  I must
learn patience.

Anyway, the answer (in case anybody else wishes to know) is that this is
controlled by the variable ~bibtex-completion-format-citation-functions~
and which defaults to using ~bib-completion-format-citation-ebib~.  I am
not sure this is a reasonable default given that org does not understand
(out of the box) ebib: links.

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.2.2-324-gd58827

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

* Re: ivy-bibtex and orgmode inserts ebib: link
  2019-03-22 11:10 ` Eric S Fraga
@ 2019-03-22 11:29   ` Eric S Fraga
  2019-03-22 11:50     ` Nicolas Goaziou
                       ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Eric S Fraga @ 2019-03-22 11:29 UTC (permalink / raw)
  To: emacs-orgmode

I am going down a rabbit hole here...

Short question: how can I add a new link type to org?  It used to be
that we would use ~org-add-link-type~ but this is
deprecated.  Fine.  The documentation points to
~org-link-set-parameters~ instead but this can only set the parameters
for known links.  Known links seem to be defined by a complex regex in
~org-link-types-re~.

What is the replacement for ~org-add-link-type~ in the latest version of
org, if any?  Or do I have to both add to the regex and set link
parameters separately?

Thank you!
-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.2.2-324-gd58827

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

* Re: ivy-bibtex and orgmode inserts ebib: link
  2019-03-22 11:29   ` Eric S Fraga
@ 2019-03-22 11:50     ` Nicolas Goaziou
  2019-03-22 11:59     ` John Kitchin
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Nicolas Goaziou @ 2019-03-22 11:50 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

Eric S Fraga <esflists@gmail.com> writes:

> I am going down a rabbit hole here...
>
> Short question: how can I add a new link type to org?  It used to be
> that we would use ~org-add-link-type~ but this is
> deprecated.  Fine.  The documentation points to
> ~org-link-set-parameters~ instead but this can only set the parameters
> for known links.  Known links seem to be defined by a complex regex in
> ~org-link-types-re~.
>
> What is the replacement for ~org-add-link-type~ in the latest version of
> org, if any?  Or do I have to both add to the regex and set link
> parameters separately?

From master, you can inspect any library prefixed with "ol-". For
example, "ol-info.el" uses this:

        (org-link-set-parameters "info"
        			 :follow #'org-info-open
        			 :export #'org-info-export
        			 :store #'org-info-store-link)

and defines each function thereafter.

Welcome to the rabbit ol ;)

Regards,

-- 
Nicolas Goaziou

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

* Re: ivy-bibtex and orgmode inserts ebib: link
  2019-03-22 11:29   ` Eric S Fraga
  2019-03-22 11:50     ` Nicolas Goaziou
@ 2019-03-22 11:59     ` John Kitchin
  2019-03-22 12:06     ` Joost Kremers
  2019-03-22 12:14     ` Eric S Fraga
  3 siblings, 0 replies; 8+ messages in thread
From: John Kitchin @ 2019-03-22 11:59 UTC (permalink / raw)
  To: emacs-orgmode

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

I guess this
http://kitchingroup.cheme.cmu.edu/blog/2016/11/04/New-link-features-in-org-9/
will show you most of what you need to make new links.
 org-link-set-parameters Also makes new links.

On Fri, Mar 22, 2019 at 7:37 AM Eric S Fraga <esflists@gmail.com> wrote:

> I am going down a rabbit hole here...
>
> Short question: how can I add a new link type to org?  It used to be
> that we would use ~org-add-link-type~ but this is
> deprecated.  Fine.  The documentation points to
> ~org-link-set-parameters~ instead but this can only set the parameters
> for known links.  Known links seem to be defined by a complex regex in
> ~org-link-types-re~.
>
> What is the replacement for ~org-add-link-type~ in the latest version of
> org, if any?  Or do I have to both add to the regex and set link
> parameters separately?
>
> Thank you!
> --
> Eric S Fraga via Emacs 27.0.50, Org release_9.2.2-324-gd58827
>
> --
John

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

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

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

* Re: ivy-bibtex and orgmode inserts ebib: link
  2019-03-22 11:29   ` Eric S Fraga
  2019-03-22 11:50     ` Nicolas Goaziou
  2019-03-22 11:59     ` John Kitchin
@ 2019-03-22 12:06     ` Joost Kremers
  2019-03-22 12:22       ` Eric S Fraga
  2019-03-22 12:14     ` Eric S Fraga
  3 siblings, 1 reply; 8+ messages in thread
From: Joost Kremers @ 2019-03-22 12:06 UTC (permalink / raw)
  To: emacs-orgmode


On Fri, Mar 22 2019, Eric S Fraga wrote:
> I am going down a rabbit hole here...
>
> Short question: how can I add a new link type to org?  It used 
> to be
> that we would use ~org-add-link-type~ but this is
> deprecated.  Fine.  The documentation points to
> ~org-link-set-parameters~ instead but this can only set the 
> parameters
> for known links.  Known links seem to be defined by a complex 
> regex in
> ~org-link-types-re~.
>
> What is the replacement for ~org-add-link-type~ in the latest 
> version of
> org, if any?  Or do I have to both add to the regex and set link
> parameters separately?

I'm pretty sure the regex is created automatically. I only needed 
to do this:

    (org-link-set-parameters "ebib" :follow #'org-ebib-open :store 
    #'org-ebib-store-link)

And then define the functions `org-ebib-open` and 
`org-ebib-store-link`. (Cf. 
<https://github.com/joostkremers/ebib/blob/master/org-ebib.el>).

And yes, I apologize for the irony. ;-)


-- 
Joost Kremers
Life has its moments

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

* Re: ivy-bibtex and orgmode inserts ebib: link
  2019-03-22 11:29   ` Eric S Fraga
                       ` (2 preceding siblings ...)
  2019-03-22 12:06     ` Joost Kremers
@ 2019-03-22 12:14     ` Eric S Fraga
  3 siblings, 0 replies; 8+ messages in thread
From: Eric S Fraga @ 2019-03-22 12:14 UTC (permalink / raw)
  To: emacs-orgmode

On Friday, 22 Mar 2019 at 11:29, Eric S Fraga wrote:
> I am going down a rabbit hole here...

And came back out again.  Ignore this whole thread of self-indulgent
posts!  ~org-link-set-parameters~ does the job for me after
all.  Problem was that the regex does get updated but doesn't affect any
open buffers...  My fault.

Thanks and sorry for the noise.

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.2.2-324-gd58827

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

* Re: ivy-bibtex and orgmode inserts ebib: link
  2019-03-22 12:06     ` Joost Kremers
@ 2019-03-22 12:22       ` Eric S Fraga
  0 siblings, 0 replies; 8+ messages in thread
From: Eric S Fraga @ 2019-03-22 12:22 UTC (permalink / raw)
  To: Joost Kremers; +Cc: emacs-orgmode

On Friday, 22 Mar 2019 at 13:06, Joost Kremers wrote:
> I'm pretty sure the regex is created automatically. I only needed to
> do this:

Yes, I was confused...  <blush>

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.2.2-324-gd58827

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

end of thread, other threads:[~2019-03-22 12:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-22 10:39 ivy-bibtex and orgmode inserts ebib: link Eric S Fraga
2019-03-22 11:10 ` Eric S Fraga
2019-03-22 11:29   ` Eric S Fraga
2019-03-22 11:50     ` Nicolas Goaziou
2019-03-22 11:59     ` John Kitchin
2019-03-22 12:06     ` Joost Kremers
2019-03-22 12:22       ` Eric S Fraga
2019-03-22 12:14     ` 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).