all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jack Kamm <jackkamm@gmail.com>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: Month-week and quarter-week datetrees (RFC and package announcement)
Date: Mon, 30 Dec 2024 08:20:28 -0800	[thread overview]
Message-ID: <87ldvx3zxv.fsf@gmail.com> (raw)
In-Reply-To: <871pxqhj85.fsf@localhost>

Ihor Radchenko <yantar92@posteo.net> writes:

>> +        ;; Support the old way of tree placement, using a property
>> +        (let ((prop (and legacy-prop (org-find-property legacy-prop))))
>> +          (if prop
>> +              (progn
>> +                (goto-char prop)
>> +	        (org-narrow-to-subtree)
>> +                (setq tree (car (org-element-contents (org-element-parse-buffer 'headline)))))
>> +            (setq tree (org-element-parse-buffer)))))
>
> Why do you need object granularity by default (second call to
> `org-element-parse-buffer')?
> Also, more importantly, do you have to run the full parsing here? Maybe
> utilize `org-element-cache-map' instead? Full parsing is going to be
> much slower.

We don't need object granularity, that was an oversight on my part --
should have specified headline granularity.

Does `org-element-cache-map' traverse elements in the order they're in
the buffer?  That is something we need for this.

On my working branch I have an earlier commit that implements many of
the improvements here but using the old regexp search way instead of the
org-element way.  Would it be worth reverting to that point?
Specifically, the new `org-datetree-find-create-entry' that allows for
nested years/quarters/months/weeks/days is still pretty straightforward
to implement in the regexp approach.  The more general
`org-datetree-find-create-hierarchy' (that allows elisp hackers to build
new kinds of datetrees) might be trickier without org-element, but we
could also defer that for future work.


  reply	other threads:[~2024-12-30 16:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-30 19:41 Month-week and quarter-week datetrees (RFC and package announcement) Jack Kamm
2023-12-31 14:50 ` Ihor Radchenko
2023-12-31 18:16   ` Jack Kamm
2024-12-16 18:49     ` Ihor Radchenko
2024-12-28  6:09       ` Jack Kamm
2024-12-29  9:18       ` Jack Kamm
2024-12-29 10:33         ` Ihor Radchenko
2024-12-30 16:20           ` Jack Kamm [this message]
2024-12-30 17:11             ` Ihor Radchenko
2024-12-31  1:56           ` Jack Kamm
2025-01-01  9:14             ` Ihor Radchenko
2025-01-01 18:30               ` Jack Kamm

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

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

  git send-email \
    --in-reply-to=87ldvx3zxv.fsf@gmail.com \
    --to=jackkamm@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.