From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ken Mankoff Subject: Re: Hide empty custom agenda sections Date: Fri, 28 Jun 2013 12:34:58 -0400 Message-ID: References: <87fvw3oarm.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e0115e8e8a8263b04e03975cb Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsbdU-0003H2-Rp for emacs-orgmode@gnu.org; Fri, 28 Jun 2013 12:35:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UsbdT-0001Kf-JJ for emacs-orgmode@gnu.org; Fri, 28 Jun 2013 12:35:00 -0400 Received: from mail-ob0-x22e.google.com ([2607:f8b0:4003:c01::22e]:44941) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsbdT-0001KZ-Cb for emacs-orgmode@gnu.org; Fri, 28 Jun 2013 12:34:59 -0400 Received: by mail-ob0-f174.google.com with SMTP id wd20so2162718obb.33 for ; Fri, 28 Jun 2013 09:34:58 -0700 (PDT) In-Reply-To: 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org-mode --089e0115e8e8a8263b04e03975cb Content-Type: text/plain; charset=ISO-8859-1 So I tried adding a "(nil)" in the custom agenda section. If this were allowed (presumably ignored), I could write a function that returns nil unless there were items tagged REFILE, in which case it would return (tags "REFILE" ((org-agenda-overriding-header "REFILE"))) But having (nil) caused an error. I guess I could make the entire "My Custom Agenda" section be the output of a function, but that seems overly complex. -k. On Thu, Jun 27, 2013 at 11:18 AM, Ken Mankoff wrote: > Hi Bastien, > > Here is my custom agenda section. I'd like to have the DEADLINE and the > REFILE only show up if items exist in those sections, not when they are > empty. Actually, I guess I'd like this for all sections. > > (setq org-agenda-custom-commands > '(("c" "My Custom Agenda" > ( > (tags "REFILE" ((org-agenda-overriding-header "REFILE"))) > (tags-todo "+DEADLINE<=\"<+3d>\"" > ( > (org-agenda-overriding-header "Deadline <= 3 Days") > )) > (tags-todo "+SCHEDULED<\"\"" > ( > (org-agenda-overriding-header "Scheduled Today") > )) > (todo "INPROGRESS" ((org-agenda-overriding-header "In > Progress"))) > (todo "WAITING|VERIFY" ((org-agenda-overriding-header "Waiting > or Verify"))) > (agenda "" ( > (org-agenda-overriding-header "Scheduled") > (org-deadline-warning-days 0) > )) > (todo "SOMEDAY" ((org-agenda-overriding-header "Someday"))) > (tags "REFILE" ((org-agenda-overriding-header "REFILE"))) > ) nil ("org.txt" "org.html" "org.ics")))) > > > > On Thu, Jun 27, 2013 at 10:44 AM, Bastien wrote: > >> Hi Ken, >> >> Ken Mankoff writes: >> >> > Right now I have this at the bottom of my custom agenda, and it is >> > therefore often off-screen. I would like to have it at the top, but >> > only appear when there are items under this section. Most of the time >> > it is there and three lines are wasting space (header separator ==== >> > =, header "REFILE", and a blank line). >> >> So you are using agenda blocks, right? >> >> Please post the skeleton of your custom agendas so that we can better >> understand. >> >> Thanks, >> >> -- >> Bastien >> > > --089e0115e8e8a8263b04e03975cb Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
So I tried adding a "(nil)" in the custom agenda= section. If this were allowed (presumably ignored), I could write a functi= on that returns nil unless there were items tagged REFILE, in which case it= would return=A0

=A0 (tags "RE= FILE" ((org-agenda-overriding-header "REFILE")))
=

But having (nil) caused an error. I guess I could make= the entire "My Custom Agenda" section be the output of a functio= n, but that seems overly complex.=A0

=A0 -k.


On Thu, Jun 27, 2013 at 11:18 AM, Ken Mankoff <<= a href=3D"mailto:mankoff@gmail.com" target=3D"_blank">mankoff@gmail.com= > wrote:
Hi Bastien,

<= div>Here is my custom agenda section. I'd like to have the DEADLINE and= the REFILE only show up if items exist in those sections, not when they ar= e empty. Actually, I guess I'd like this for all sections.

(setq org-agenda-custom-commands
=A0 =A0= =A0 '(("c" "My Custom Agenda"
=A0 =A0 =A0 =A0 =A0(
=A0 (tags "REFILE" ((org-agenda-overriding-header "= REFILE")))
=A0(tags-todo &quo= t;+DEADLINE<=3D\"<+3d>\""=A0
=A0 =A0 (
=A0 =A0 =A0(org-agenda-overriding-header "= Deadline <=3D 3 Days")
=A0 =A0 =A0))
=A0(tags-todo "+SCHEDUL= ED<\"<tomorrow>\""=A0
=A0 =A0 (
=A0 =A0 =A0(org-agenda-= overriding-header "Scheduled Today")
=A0 =A0 =A0))
=A0 =A0 =A0 =A0 = =A0 (todo "INPROGRESS" ((org-agenda-overriding-header "In Pr= ogress")))
=A0 =A0 =A0 =A0 =A0 (todo "WAITING|VERIFY" ((org-agenda-over= riding-header "Waiting or Verify")))
=A0(agenda "" (
=A0 =A0 =A0(org-agenda-overriding-h= eader "Scheduled")
=A0 =A0 =A0(org-deadlin= e-warning-days 0)
= =A0 =A0 =A0))
=A0 =A0 =A0 =A0 =A0 (todo "SOMEDAY" (= (org-agenda-overriding-header "Someday")))
=A0(tags "REFILE&qu= ot; ((org-agenda-overriding-header "REFILE"))) =A0=A0
=A0) nil ("org.txt" "org.html" &quo= t;org.ics"))))



On Thu, Jun 27, 2013 = at 10:44 AM, Bastien <bzg@gnu.org> wrote:
Hi Ken,

Ken Mankoff <mank= off@gmail.com> writes:

> Right now I have this at the bottom of my custom agenda, and it is
> therefore often off-screen. I would like to have it at the top, but > only appear when there are items under this section. Most of the time<= br> > it is there and three lines are wasting space (header separator =3D=3D= =3D=3D
> =3D, header "REFILE", and a blank line).

So you are using agenda blocks, right?

Please post the skeleton of your custom agendas so that we can better
understand.

Thanks,

--
=A0Bastien


--089e0115e8e8a8263b04e03975cb--