From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Programming with org-element-cache -> short introduction? Date: Mon, 11 Aug 2014 15:16:52 +0200 Message-ID: <87iolzp3nf.fsf@nicolasgoaziou.fr> References: <87y4uxp3w2.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47064) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGpSW-0003TC-9W for emacs-orgmode@gnu.org; Mon, 11 Aug 2014 09:16:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XGpSM-0008SR-5w for emacs-orgmode@gnu.org; Mon, 11 Aug 2014 09:16:20 -0400 Received: from relay5-d.mail.gandi.net ([2001:4b98:c:538::197]:36102) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGpSL-0008SM-Va for emacs-orgmode@gnu.org; Mon, 11 Aug 2014 09:16:10 -0400 In-Reply-To: <87y4uxp3w2.fsf@gmail.com> (Thorsten Jolitz's message of "Sun, 10 Aug 2014 02:47:09 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Thorsten Jolitz Cc: emacs-orgmode@gnu.org Hello, Thorsten Jolitz 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