From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrian Bradd Subject: org-agenda-skip-function does not find inherited tags Date: Mon, 4 Sep 2017 11:06:40 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c124f703e0b3a05585e75e8" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dosyS-00081x-0b for emacs-orgmode@gnu.org; Mon, 04 Sep 2017 11:08:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dosxX-0006dF-Ku for emacs-orgmode@gnu.org; Mon, 04 Sep 2017 11:07:40 -0400 Received: from mail-pg0-x22b.google.com ([2607:f8b0:400e:c05::22b]:35536) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dosxX-0006c3-Cg for emacs-orgmode@gnu.org; Mon, 04 Sep 2017 11:06:43 -0400 Received: by mail-pg0-x22b.google.com with SMTP id d5so2035049pgf.2 for ; Mon, 04 Sep 2017 08:06:42 -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 --94eb2c124f703e0b3a05585e75e8 Content-Type: text/plain; charset="UTF-8" Hello, I have the following custom agenda command: (setq org-agenda-custom-commands '(("ww" "Work 2 day view" ((agenda "" ((org-agenda-files '("~/tmp/tmp.org")) (org-agenda-skip-function '(org-agenda-skip-entry-if 'notregexp ":@work:")) (org-agenda-start-on-weekday nil) (org-agenda-span 2) (org-agenda-overriding-header "\n2 day work view\n-----------------\n"))))))) Given the sample file below: * Top heading with tags :@work:admin: ** Next heading (inherited tags) SCHEDULED: <2017-09-04 Mon> ** Next heading (explicit tags) :@work:admin: SCHEDULED: <2017-09-04 Mon> The agenda will only display headings that have the tag explicitly defined. In this case, "Next heading (explicit tags)". Is there a way I can convince the agenda to honour inherited tags in this case? Cheers, Adrian --94eb2c124f703e0b3a05585e75e8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

I have the following custom agen= da command:

(setq org-agenda-custom-commands<= /div>
=C2=A0 =C2=A0 =C2=A0 '(("ww" "Work 2 day view&= quot;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((agenda ""
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((org-agenda-files '(&q= uot;~/tmp/tmp.org"))<= /div>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-agenda-skip-functi= on '(org-agenda-skip-entry-if 'notregexp ":@work:"))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-agenda-start-on-weekda= y nil)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-agenda-span= 2)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-agenda-overrid= ing-header "\n2 day work view\n-----------------\n")))))))

Given the sample file below:

* Top heading with tags =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 =C2=A0 =C2=A0 =C2=A0 :@work:admin:
** Next heading (in= herited tags)
=C2=A0 =C2=A0SCHEDULED: <2017-09-04 Mon>
** Next heading (explicit tags) =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 :@work:admin:
=C2=A0 =C2=A0SCHEDULED: <2017-09-04 Mon><= /div>

The agenda will only display headings that h= ave the tag explicitly defined. In this case, "Next heading (explicit = tags)".

Is there a way I can convince the age= nda to honour inherited tags in this case?

Cheers,=

Adrian


--94eb2c124f703e0b3a05585e75e8-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: org-agenda-skip-function does not find inherited tags Date: Wed, 06 Sep 2017 18:27:07 +0200 Message-ID: <87bmmnaj38.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpdAh-0001Yh-BC for emacs-orgmode@gnu.org; Wed, 06 Sep 2017 12:27:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dpdAc-0001L1-DL for emacs-orgmode@gnu.org; Wed, 06 Sep 2017 12:27:23 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:36172) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dpdAc-0001JH-78 for emacs-orgmode@gnu.org; Wed, 06 Sep 2017 12:27:18 -0400 In-Reply-To: (Adrian Bradd's message of "Mon, 4 Sep 2017 11:06:40 -0400") 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: Adrian Bradd Cc: emacs-orgmode@gnu.org Hello, Adrian Bradd writes: > I have the following custom agenda command: > > (setq org-agenda-custom-commands > '(("ww" "Work 2 day view" > ((agenda "" > ((org-agenda-files '("~/tmp/tmp.org")) > (org-agenda-skip-function '(org-agenda-skip-entry-if 'notregexp > ":@work:")) > (org-agenda-start-on-weekday nil) > (org-agenda-span 2) > (org-agenda-overriding-header "\n2 day work > view\n-----------------\n"))))))) > > Given the sample file below: > > * Top heading with tags > :@work:admin: > ** Next heading (inherited tags) > SCHEDULED: <2017-09-04 Mon> > ** Next heading (explicit tags) > :@work:admin: > SCHEDULED: <2017-09-04 Mon> > > The agenda will only display headings that have the tag explicitly defined. > In this case, "Next heading (explicit tags)". > > Is there a way I can convince the agenda to honour inherited tags in this > case? You write a more appropriate function and use it as `org-agenda-skip-function'. It could re-use the following snippet: (not (member "@work" (org-split-string (org-entry-get (point) "ALLTAGS")))) Regards, -- Nicolas Goaziou From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Porter Subject: Re: org-agenda-skip-function does not find inherited tags Date: Sat, 09 Sep 2017 00:36:56 -0500 Message-ID: <87o9qkbfgn.fsf@alphapapa.net> References: <87bmmnaj38.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqYSI-00044H-Ou for emacs-orgmode@gnu.org; Sat, 09 Sep 2017 01:37:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dqYSF-0008GN-M0 for emacs-orgmode@gnu.org; Sat, 09 Sep 2017 01:37:22 -0400 Received: from [195.159.176.226] (port=35073 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dqYSF-0008Fg-Ei for emacs-orgmode@gnu.org; Sat, 09 Sep 2017 01:37:19 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dqYS1-0000fp-Nh for emacs-orgmode@gnu.org; Sat, 09 Sep 2017 07:37:05 +0200 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 I think the function org-get-tags-at should also be helpful here. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrian Bradd Subject: Re: org-agenda-skip-function does not find inherited tags Date: Sun, 10 Sep 2017 20:10:52 -0400 Message-ID: References: <87bmmnaj38.fsf@nicolasgoaziou.fr> <87o9qkbfgn.fsf@alphapapa.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c1b4a7c7fb9860558dec241" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55255) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drCJU-0001DE-64 for emacs-orgmode@gnu.org; Sun, 10 Sep 2017 20:10:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1drCJT-0001Kw-9Y for emacs-orgmode@gnu.org; Sun, 10 Sep 2017 20:10:56 -0400 Received: from mail-pf0-x230.google.com ([2607:f8b0:400e:c00::230]:36341) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1drCJT-0001KW-2u for emacs-orgmode@gnu.org; Sun, 10 Sep 2017 20:10:55 -0400 Received: by mail-pf0-x230.google.com with SMTP id e199so11602533pfh.3 for ; Sun, 10 Sep 2017 17:10:53 -0700 (PDT) In-Reply-To: <87o9qkbfgn.fsf@alphapapa.net> 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: Adam Porter , emacs-orgmode@gnu.org --94eb2c1b4a7c7fb9860558dec241 Content-Type: text/plain; charset="UTF-8" Thanks for the pointers. This is what I came up with: (defun abradd-agenda-tags-inherited (tags) (let (beg end m) (org-back-to-heading t) (setq beg (point) end (progn (outline-next-heading) (1- (point)))) (goto-char beg) (and (not (member tags (org-get-tags-at))) end))) I copied mostly from org-agenda-skip-if. It isn't very versatile, but works for now. On 9 September 2017 at 01:36, Adam Porter wrote: > I think the function org-get-tags-at should also be helpful here. > > > --94eb2c1b4a7c7fb9860558dec241 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Tha= nks for the pointers. This is what I came up with:

(defun abradd-agenda= -tags-inherited (tags)
=C2=A0 (let (beg e= nd m)
=C2=A0 =C2=A0 (org-back-to-heading = t)
=C2=A0 =C2=A0 (setq beg (point)
<= div class=3D"gmail_default">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 end (progn (= outline-next-heading) (1- (point))))
=C2= =A0 =C2=A0 (goto-char beg)
=C2=A0 =C2=A0 = (and
=C2=A0 =C2=A0 =C2=A0 (not (member ta= gs (org-get-tags-at)))
=C2=A0 =C2=A0 =C2= =A0 end)))

I copied mostly from org-agenda-skip-if= . It isn't very versatile, but works for now.

On 9 September 2017 at 01= :36, Adam Porter <adam@alphapapa.net> wrote:
I think the function org-get-tags-at should also be hel= pful here.



--94eb2c1b4a7c7fb9860558dec241-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Re: org-agenda-skip-function does not find inherited tags Date: Mon, 11 Sep 2017 19:35:06 +0000 Message-ID: References: <87bmmnaj38.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="089e08255b60c80e6a0558ef06b1" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33217) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drUcO-0001FU-4E for emacs-orgmode@gnu.org; Mon, 11 Sep 2017 15:43:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1drUcN-00022S-6i for emacs-orgmode@gnu.org; Mon, 11 Sep 2017 15:43:40 -0400 Received: from mail-yw0-x233.google.com ([2607:f8b0:4002:c05::233]:34727) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1drUcN-00022F-1F for emacs-orgmode@gnu.org; Mon, 11 Sep 2017 15:43:39 -0400 Received: by mail-yw0-x233.google.com with SMTP id r85so23915466ywg.1 for ; Mon, 11 Sep 2017 12:43:38 -0700 (PDT) In-Reply-To: <87bmmnaj38.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 , Adrian Bradd Cc: emacs-orgmode@gnu.org --089e08255b60c80e6a0558ef06b1 Content-Type: text/plain; charset="UTF-8" On Wed, Sep 6, 2017 at 12:33 PM Nicolas Goaziou wrote: > You write a more appropriate function and use it as > `org-agenda-skip-function'. It could re-use the following snippet: > > (not (member "@work" (org-split-string (org-entry-get (point) > "ALLTAGS")))) > TIL about ALLTAGS and other Special Properties. That org-split-string though needs the separator argument though, right? (org-split-string (org-entry-get (point) "ALLTAGS") ":") -- Kaushal Modi --089e08255b60c80e6a0558ef06b1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Sep 6,= 2017 at 12:33 PM Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
You write a more appropriate function and use it as
`org-agenda-skip-function'. It could re-use the following snippet:

=C2=A0 (not (member "@work" (org-split-string (org-entry-get (poi= nt) "ALLTAGS"))))

TIL about A= LLTAGS and other Special Properties.

That org-spli= t-string though needs the separator argument though, right?

<= /div>
(org-split-string (org-entry-get (point) "ALLTAGS") &qu= ot;:")
--

Kaushal Mo= di

--089e08255b60c80e6a0558ef06b1--