emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Agenda filter by any tag seems to be broken


From: Eric Abrahamsen
Subject: Re: [O] Agenda filter by any tag seems to be broken
Date: Wed, 18 May 2016 11:31:49 +0800
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.1.50 (gnu/linux)

Kaushal Modi <address@hidden> writes:

> On Mon, May 16, 2016 at 8:38 PM Eric Abrahamsen
> <address@hidden> 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.

I'm not running org from git anymore, just org-plus-contrib from...
melpa? Actually, since Emacs' package management has no way of
specifying "provides", I've got both org and org-plus-contrib. But
that's not the issue, see below...

>     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))

Okay, there's the problem. In the org git repo, the code above has been
that way since it was added in 2015. In the package-manager version,
however, it now looks like this:

      (let* ((tag (substring x 1))
             (isregexp (and (equal "{" (substring tag 0 1))
                            (equal "}" (substring tag -1))))
             regexp)

And the `substring' calls raise the error. The code is the same in the
"org" and "org-plus-contrib" packages.

I don't know where the different code comes from, or who maintains it,
or why it's different from the org git repo, but it would be nice if
someone could look into fixing that!

Eric




reply via email to

[Prev in Thread] Current Thread [Next in Thread]