[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Subtree export problems
From: |
Rasmus |
Subject: |
Re: [O] Subtree export problems |
Date: |
Sun, 07 Feb 2016 01:14:51 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Hi Tom,
Thomas S. Dye <address@hidden> writes:
How could it do anything else? Try to narrow to the subtree
and run your code (see also org-export-as and how subtree
export works; it narrows). You will see that your code
returns nil.
Interesting, thanks, that makes sense. So, IIUC narrowing puts
the "keywords" at the top of the buffer out of scope.
I agree.
I fiddled around a bit and came up with this, which seems to
work: ...
Cool! Perhaps something like org-with-wide-buffer would allow you
to recapture your keywords/properties. Otherwise you might be
able to add a λ to org-export-before-processing-hook to add your
own known keywords/properties to each headline.
You are using a hack to use something that you think looks like
a Org keyword, but which is not (in particular it’s unknown to
ox backends). I think you can check
org-export-get-environment and org-export-define-backend to
appreciate this.
Am I right that what John Kitchin's code (jk-org-kwd) refers to
as "keyword" should be called "property" instead? This makes
more sense to me in light of the above.
Probably. But it was formatted as a keyword (i.e. #+KEYWORD:).
Also, I don't understand what you mean by "hack". Should I be
wary of using John's functions? I find them handy to mark bits
of information that the user (usually me) might want to change.
They save the need to rummage around a long document to find
where the information is actually used. Should I use other
functions instead?
I’d say "no". I rely on plenty of hacks in my own documents (13
filters in my standard Makefile conf.el). There's nothing wrong
with that as long as you know that you are playing with the fire.
In this case you need to worry about the scope. Probably other
pitfalls exist.
Rasmus
--
When in doubt, do it!