From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Re: Agenda filter by any tag seems to be broken Date: Tue, 17 May 2016 19:40:14 +0000 Message-ID: References: <87oa8a7hxp.fsf@ericabrahamsen.net> <8760udh644.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113731409a6ae605330ee969 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2qTi-0000g1-Ew for emacs-orgmode@gnu.org; Tue, 17 May 2016 21:40:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2kqw-0001d7-7K for emacs-orgmode@gnu.org; Tue, 17 May 2016 15:40:27 -0400 Received: from mail-oi0-x22a.google.com ([2607:f8b0:4003:c06::22a]:35317) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2kqw-0001d3-0T for emacs-orgmode@gnu.org; Tue, 17 May 2016 15:40:26 -0400 Received: by mail-oi0-x22a.google.com with SMTP id x19so42207372oix.2 for ; Tue, 17 May 2016 12:40:25 -0700 (PDT) In-Reply-To: <8760udh644.fsf@ericabrahamsen.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: Eric Abrahamsen , emacs-orgmode@gnu.org --001a113731409a6ae605330ee969 Content-Type: text/plain; charset=UTF-8 On Mon, May 16, 2016 at 8:38 PM Eric Abrahamsen wrote: > Starting with emacs -Q, then adding the org-plus-contrib directory to > load-path: > Are you installing both the git master version and org-plus-contrib? I do not have org-plus-contrib in my load-path. The only org I have in the load-path is the git master version. If you *are* installing both versions, then that could probably explain the issue you are facing. > M-x org-agenda > t ;; all todos, an empty list of course > / > SPC > > And I get the error. > I tried that. But I don't get any error. I took the original org-agenda-filter-make-matcher-tag-exp function from the git master and added few debug statements as below: (defun org-agenda-filter-make-matcher-tag-exp (tags op) "Return a form associated to tag-expression TAGS. Build a form testing a line for agenda filter for tag-expressions. OP is an operator of type CHAR that allows the function to set the right switches in the returned form." (message "arg tags: %S" tags) (message "arg op: %S" op) (let (form ret) ;; Any of the expressions can match if OP is +, all must match if ;; the operator is -. (dolist (x tags (cons (if (eq op ?-) 'and 'or) form)) (let* ((tag (substring x 1)) (f (cond ((string= "" tag) '(not tags)) ((and (string-match-p "\\`{" tag) (string-match-p "}\\'" tag)) ;; TAG is a regexp. (list 'org-match-any-p (substring tag 1 -1) 'tags)) (t (list 'member (downcase tag) 'tags))))) (message "in let, tag: %S" tag) (message "in let, f: %S" f) (prog1 (setq ret (push (if (eq op ?-) (list 'not f) f) form)) (message "ret val: %S" ret)))))) Then when I do M-x org-agenda t / SPC, I get: arg tags: ("+") arg op: 43 in let, tag: "" in let, f: (not tags) ret val: ((not tags)) -- -- Kaushal Modi --001a113731409a6ae605330ee969 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Mon, Ma= y 16, 2016 at 8:38 PM Eric Abrahamsen <eric@ericabrahamsen.net> wrote:
Starting with emacs -Q, then adding the org-plus-contrib dire= ctory to
load-path:

Are you installing both the = git master version and org-plus-contrib? I do not have org-plus-contrib in = my load-path. The only org I have in the load-path is the git master versio= n. If you *are* installing both versions, then that could probably explain = the issue you are facing.
=C2=A0
M-x org-agenda
t ;; all todos, an empty list of course
/
SPC

And I get the error.

I tried that. But = I don't get any error.

I took the original org= -agenda-filter-make-matcher-tag-exp function from the git master and added = few debug statements as below:

(defun org-age= nda-filter-make-matcher-tag-exp (tags op)
=C2=A0 "Return a f= orm associated to tag-expression TAGS.
Build a form testing a lin= e for agenda filter for
tag-expressions.=C2=A0 OP is an operator = of type CHAR that allows the
function to set the right switches i= n the returned form."
=C2=A0 (message "arg tags: %S&quo= t; tags)
=C2=A0 (message "arg op: %S" op)
=C2= =A0 (let (form ret)
=C2=A0 =C2=A0 ;; Any of the expressions can m= atch if OP is +, all must match if
=C2=A0 =C2=A0 ;; the operator = is -.
=C2=A0 =C2=A0 (dolist (x tags (cons (if (eq op ?-) 'and= 'or) form))=C2=A0
=C2=A0 =C2=A0 =C2=A0 (let* ((tag (substrin= g x 1))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(f (cond<= /div>
((string=3D "" tag) '(not tags))
((and (string-match-p &q= uot;\\`{" tag) (string-match-p "}\\'" tag))
=C2=A0;; T= AG is a regexp.
=C2=A0(list 'org-match-any-p (substring tag 1 -1) = 9;tags))
(t (list 'member (downcase tag) 'tags)))))
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 (message "in let, tag: %S" tag)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (message "in let, f: %S" f)
(prog1<= /div>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq ret (push (if (eq= op ?-) (list 'not f) f) form))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 (message "ret val: %S" ret))))))

Then when I do M-x org-agenda t / SPC, I get:

arg tags: ("+")
arg op: 43
in let, tag= : ""
in let, f: (not tags)
ret val: ((not tag= s))

--

--
Kaushal Modi

--001a113731409a6ae605330ee969--