From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zongheng Yang Subject: Speeding up agenda custom command with org-agenda-earlier & org-agenda-later Date: Wed, 20 Jun 2018 15:24:42 -0700 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000094935e056f1a44bd" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVlX6-0003Li-Ms for emacs-orgmode@gnu.org; Wed, 20 Jun 2018 18:24:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVlX5-0005JS-GU for emacs-orgmode@gnu.org; Wed, 20 Jun 2018 18:24:56 -0400 Received: from mail-io0-x22c.google.com ([2607:f8b0:4001:c06::22c]:46837) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fVlX5-0005J5-8T for emacs-orgmode@gnu.org; Wed, 20 Jun 2018 18:24:55 -0400 Received: by mail-io0-x22c.google.com with SMTP id d22-v6so1178176iof.13 for ; Wed, 20 Jun 2018 15:24:55 -0700 (PDT) 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: "emacs-orgmode@gnu.org" --00000000000094935e056f1a44bd Content-Type: text/plain; charset="UTF-8" Hi, 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? Thanks, Zongheng --00000000000094935e056f1a44bd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

Here's an agenda custom command= that acts as the main interface I interact with org (in fact, emacs :)).

=C2=A0 (setq org-agenda-custom-commands
=C2=A0 =C2=A0 =C2=A0 =C2=A0 '(("c" "Simple agenda view= "
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((agenda "&q= uot;)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (tags "PRIOR= ITY=3D\"A\""
=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-s= kip-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 &quo= t;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 (tags-todo "PRIORITY=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/ideas.org&q= uot;))
=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:&= quot;)))
=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 (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 (org-agenda-skip-if nil '(scheduled deadline))))
=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 ))))

After I get into this view, I frequently issue many "org-agenda-earl= ier" & "org-agenda-later" commands, often in a back-and-= forth fashion, to inspect what I've done around certain periods.=C2=A0= =C2=A0

In such a use case, it seems there's no reason to not cache results.=C2=A0 Without such caching currently <= b>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 a= s successive commands can be sped up.

Is a feature= like this planned?

Thanks,
Zongheng
--00000000000094935e056f1a44bd--