[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Programming with org-element-cache -> short introduction?
From: |
Nicolas Goaziou |
Subject: |
Re: [O] Programming with org-element-cache -> short introduction? |
Date: |
Mon, 11 Aug 2014 15:16:52 +0200 |
Hello,
Thorsten Jolitz <address@hidden> writes:
> when programming with Org elements sometimes things seem to work and
> then something strange happens - what smells like a cache problem. I
> don't mean a cache bug, but a programmer (me) not taking the cache
> into account the right way.
It might also be a cache problem. Do not hesitate to report it.
> Is there a short introduction somewhere about the 'todos' and 'nogos' in
> programming with elements wrt to the org-element-cache?
The only "nogo" is to never modify (destructively) a value returned by
`org-element-at-point' or `org-element-context'. Consider their return
value as read-only, and possibly invalid as soon as you modify the
buffer.
These advices don't apply to `org-element-parse-buffer', which doesn't
use cache (if it did, it should copy cached elements beforehand anyway).
HTH,
--
Nicolas Goaziou