From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: Agenda filter by any tag seems to be broken Date: Wed, 18 May 2016 11:31:49 +0800 Message-ID: <87wpms3uu2.fsf@ericabrahamsen.net> References: <87oa8a7hxp.fsf@ericabrahamsen.net> <8760udh644.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2sDa-0002KO-Lt for emacs-orgmode@gnu.org; Tue, 17 May 2016 23:32:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2sDW-0004KY-Eh for emacs-orgmode@gnu.org; Tue, 17 May 2016 23:32:17 -0400 Received: from plane.gmane.org ([80.91.229.3]:45241) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2sDW-0004Ix-7e for emacs-orgmode@gnu.org; Tue, 17 May 2016 23:32:14 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1b2sDP-0007cO-Rw for emacs-orgmode@gnu.org; Wed, 18 May 2016 05:32:08 +0200 Received: from 123.116.192.70 ([123.116.192.70]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 18 May 2016 05:32:07 +0200 Received: from eric by 123.116.192.70 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 18 May 2016 05:32:07 +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 Kaushal Modi writes: > 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. 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