From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: Faster version of org-find-olp Date: Mon, 10 Feb 2020 10:32:05 -0800 Message-ID: <87sgjiwaxm.fsf@ericabrahamsen.net> References: <871rxku0po.fsf@alphapapa.net> <87eevazs0m.fsf@gnu.org> <87tv46me4x.fsf@ericabrahamsen.net> <87zhdq9aj7.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:38105) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1Dr4-0004XG-PH for emacs-orgmode@gnu.org; Mon, 10 Feb 2020 13:32:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1Dr0-0000lG-HH for emacs-orgmode@gnu.org; Mon, 10 Feb 2020 13:32:22 -0500 In-Reply-To: <87zhdq9aj7.fsf@gnu.org> (Bastien's message of "Mon, 10 Feb 2020 08:17:00 +0100") 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-mx.org@gnu.org Sender: "Emacs-orgmode" To: Bastien Cc: Adam Porter , emacs-orgmode@gnu.org Bastien writes: > Hi Eric, > > Eric Abrahamsen writes: > >> I ended up writing a function on top of that that does find-or-create, >> so you can go to a certain outline path, creating and inserting >> (optionally in sorted order) the missing segments as you go. It was >> fairly difficult to get right, so perhaps it will be of use to someone, >> or appropriate for Worg or even Org proper: >> >> https://github.com/girzel/timesheet.el/blob/master/timesheet.el#L250 > > thanks for this - don't hesitate to reference it somewhere on Worg if > you think that's useful. > > If you think this should go to Org's core, please make a patch and > tell what's the difference with your patch and how to test it to make > sure we really understand the issue at stake. I don't have any issue > with the current implementation of `org-find-olp' so I cannot really > know. It isn't a replacement for `org-find-olp'! It's just built on top of it. `org-find-olp' signals an error if the full path isn't found. My function looks for that error and creates the missing segments of the path. If `org-find-olp' is the equivalent of "cd" in the shell, this function is like "mkdir -p", plus the "cd" afterwards. It's nice for programmatically creating outline structures (ie can be used to create date trees and the like). I guess I think worg is sufficient -- it's a nice utility, but perhaps not necessary for core. Eric