From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: [RFC] Simple cache mechanism for `org-element-at-point' Date: Fri, 04 Oct 2013 13:43:09 +0800 Message-ID: <87li29a8wi.fsf@ericabrahamsen.net> References: <87wqlu834i.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRy9h-00020h-Ag for emacs-orgmode@gnu.org; Fri, 04 Oct 2013 01:42:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VRy9Z-0007Nq-NT for emacs-orgmode@gnu.org; Fri, 04 Oct 2013 01:42:25 -0400 Received: from plane.gmane.org ([80.91.229.3]:59438) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRy9Z-0007Nd-GZ for emacs-orgmode@gnu.org; Fri, 04 Oct 2013 01:42:17 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VRy9W-00049w-My for emacs-orgmode@gnu.org; Fri, 04 Oct 2013 07:42:14 +0200 Received: from 114.250.130.187 ([114.250.130.187]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 04 Oct 2013 07:42:14 +0200 Received: from eric by 114.250.130.187 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 04 Oct 2013 07:42:14 +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: emacs-orgmode@gnu.org Nicolas Goaziou writes: > Hello, > > The following patches introduce a simple cache mechanism for both > `org-element-at-point' and `org-element-context'. My goal is to make > them fast enough to be used in most core commands (excepted > headlines-only commands). > > Since a wrong cache can break Org behaviour badly, I would appreciate if > it could be tested a bit. You can disable cache at any time by setting > `org-element-use-cache' to nil and reset it with > `org-element-cache-reset' function. > > It may also be interesting to tweak `org-element--cache-sync-idle-time' > and `org-element--cache-merge-changes-threshold', although I don't > expect a regular user to do it. Anyway, it may lead to better default > values. > > Since cache is updated upon buffer modification, visibility status > cannot be cached properly. Since it is also buggy, the first patch > removes that data altogether. Cool! Anything in particular that we should be looking out for (structure editing, export, etc)? It has so far not set my computer on fire.