From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zongheng Yang Subject: Re: Speeding up agenda custom command with org-agenda-earlier & org-agenda-later Date: Fri, 22 Jun 2018 13:58:45 -0700 Message-ID: References: <87o9g2bl7w.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000dff8c3056f414cf6" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fWT91-0000py-2G for emacs-orgmode@gnu.org; Fri, 22 Jun 2018 16:59:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fWT90-0006fm-16 for emacs-orgmode@gnu.org; Fri, 22 Jun 2018 16:58:59 -0400 Received: from mail-it0-x22b.google.com ([2607:f8b0:4001:c0b::22b]:35337) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fWT8z-0006fO-R6 for emacs-orgmode@gnu.org; Fri, 22 Jun 2018 16:58:57 -0400 Received: by mail-it0-x22b.google.com with SMTP id a3-v6so4717273itd.0 for ; Fri, 22 Jun 2018 13:58:57 -0700 (PDT) In-Reply-To: <87o9g2bl7w.fsf@nicolasgoaziou.fr> 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" To: Nicolas Goaziou Cc: "emacs-orgmode@gnu.org" --000000000000dff8c3056f414cf6 Content-Type: text/plain; charset="UTF-8" Cool, looking forward to see the rewrite! On Fri, Jun 22, 2018 at 1:49 PM Nicolas Goaziou wrote: > Hello, > > Zongheng Yang writes: > > > Here's an agenda custom command that acts as the main interface I > interact > > with org (in fact, emacs :)). > > > > (setq org-agenda-custom-commands > > '(("c" "Simple agenda view" > > ((agenda "") > > (tags "PRIORITY=\"A\"" > > ((org-agenda-files '("~/org/work.org" "~/org/ideas.org > ")) > > (org-agenda-skip-function '(org-agenda-skip-entry-if > > 'todo 'done)) > > (org-agenda-overriding-header "High-priority tasks:") > > )) > > (tags-todo "PRIORITY=\"C\"" > > ((org-agenda-files '("~/org/work.org" "~/org/ > > ideas.org")) > > (org-agenda-overriding-header "Long-term:"))) > > (alltodo "" > > ((org-agenda-skip-function > > '(or (zongheng-org-skip-subtree-if-priority ?A) > > (zongheng-org-skip-subtree-if-priority ?C) > > (org-agenda-skip-if nil '(scheduled > deadline)))) > > (org-agenda-overriding-header "Other tasks:"))) > > )))) > > > > After I get into this view, I frequently issue many "org-agenda-earlier" > & > > "org-agenda-later" commands, often in a back-and-forth fashion, to > inspect > > what I've done around certain periods. > > > > In such a use case, it seems there's *no reason to not cache results*. > > Without such caching currently *the latency of switching is really high*; > > with such a caching, I'm happy to pay an one-time latency/CPU cost for > the > > first command, as long as successive commands can be sped up. > > > > Is a feature like this planned? > > I don't think is it planned. Feel free to implement it, if you want to. > > I consider Org agenda in dire need of rewriting, though. for better > scalability and easier maintenance. > > Regards, > > -- > Nicolas Goaziou > --000000000000dff8c3056f414cf6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Cool, looking forward to see the rewrite!

On Fri, Jun 22, 2018 at 1:49 PM Nicola= s Goaziou <mail@nicolasgoaziou= .fr> wrote:
Hello,

Zongheng Yang <zongheng.y@gmail.com> writes:

> Here's an agenda custom command that acts as the main interface I = interact
> with org (in fact, emacs :)).
>
>=C2=A0 =C2=A0(setq org-agenda-custom-commands
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0'(("c" "Simple age= nda view"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((agenda "")
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(tags "PRIORITY=3D= \"A\""
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((= org-agenda-files '("~/org/work.org" "~/org/ideas.org"))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (= org-agenda-skip-function '(org-agenda-skip-entry-if
> 'todo 'done))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (= org-agenda-overriding-header "High-priority tasks:")
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 )= )
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(tags-todo "PRIORI= TY=3D\"C\""
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 ((org-agenda-files '("~/org/work.org" "~/org/ > idea= s.org"))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0(org-agenda-overriding-header "Long-term:")))=
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(alltodo "" >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 ((org-agenda-skip-function
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 '(or (zongheng-org-skip-subtree-if-priority ?A)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(zongheng-org-skip-subtree-if-priority ?C= )
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(org-agenda-skip-if nil '(scheduled d= eadline))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0(org-agenda-overriding-header "Other tasks:")))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0))))
>
> After I get into this view, I frequently issue many "org-agenda-e= arlier" &
> "org-agenda-later" commands, often in a back-and-forth fashi= on, to inspect
> what I've done around certain periods.
>
> In such a use case, it seems there's *no reason to not cache resul= ts*.
> Without such caching currently *the latency of switching is really hig= h*;
> with such a caching, I'm happy to pay an one-time latency/CPU cost= for the
> first command, as long as successive commands can be sped up.
>
> Is a feature like this planned?

I don't think is it planned. Feel free to implement it, if you want to.=

I consider Org agenda in dire need of rewriting, though. for better
scalability and easier maintenance.

Regards,

--
Nicolas Goaziou
--000000000000dff8c3056f414cf6--