emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Bastien <bzg@gnu.org>
Cc: Adam Porter <adam@alphapapa.net>, emacs-orgmode@gnu.org
Subject: Re: Faster version of org-find-olp
Date: Mon, 10 Feb 2020 10:32:05 -0800	[thread overview]
Message-ID: <87sgjiwaxm.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <87zhdq9aj7.fsf@gnu.org> (Bastien's message of "Mon, 10 Feb 2020 08:17:00 +0100")

Bastien <bzg@gnu.org> writes:

> Hi Eric,
>
> Eric Abrahamsen <eric@ericabrahamsen.net> 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

      reply	other threads:[~2020-02-10 18:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-16 23:53 Faster version of org-find-olp Adam Porter
2019-08-17  0:10 ` Adam Porter
2020-02-04  8:16 ` Bastien
2020-02-04 17:54   ` Eric Abrahamsen
2020-02-10  7:17     ` Bastien
2020-02-10 18:32       ` Eric Abrahamsen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sgjiwaxm.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=adam@alphapapa.net \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).