emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Programmatically handling org files


From: Joost Kremers
Subject: Re: [O] Programmatically handling org files
Date: Mon, 12 Sep 2016 23:59:05 +0200
User-agent: mu4e 0.9.17; emacs 25.1.1

On Mon, Sep 12 2016, John Kitchin wrote:
>> I was wondering if there is some sort of (semi)official API for handling
>> org files programmatically. That's to say, is there a documented way for
>> non-org Emacs packages to manipulate (the contents of) org files?
>
> None that I know of. A non-elisp lib would have to be able to parse the
> org-files.

As you've already realised, I was asking about Elisp code that's not
part of or intended to extend orgmode.

>> Also, I was wondering if there's a way to hook into org-store-link. For
>> a particular major mode, I would like to be able to define what kind of
>> link is created when the user calls `org-store-link`. I looked at the
>> source of `org-store-link` and it looks like the answer is no, but I
>> thought I'd ask anyway. I could of course create the link myself and add
>> it to `org-stored-links` but that feels rather hackish and I suspect
>> will blow up in my face at some point in the future.
>
> You want to add a function to org-store-link-functions. The function
> should check if it is responsible for creating this link (for example by
> looking at the major mode). If not, it must exit and return nil. If yes,
> it should return a non-nil value after a calling `org-store-link-props'
> with a list of properties and values.

Great, thanks! I looked at the source of `org-store-link', but this
wasn't obvious to me. :-/


-- 
Joost Kremers
Life has its moments



reply via email to

[Prev in Thread] Current Thread [Next in Thread]