org-ql icon indicating copy to clipboard operation
org-ql copied to clipboard

"and" predicate appears to not be commutative (argument ordering gives different results)

Open parsoj opened this issue 3 years ago • 2 comments

running:

(org-ql-search org-agenda-files '(and (todo "ROUTINE" "NEXT" "AVAILABLE") (deadline :to today) ) ) will give me results, whereas running (org-ql-search org-agenda-files '(and (deadline :to today) (todo "ROUTINE" "NEXT" "AVAILABLE") ) ) gives me no results. Shouldn't ordering make no difference, here?

parsoj avatar Dec 27 '20 23:12 parsoj

I am unable to reproduce this issue.

  1. emacs-sandbox.sh -i org-ql
  2. C-x C-f /tmp/172.org.
  3. Paste:
#+TODO: TODO ROUTINE NEXT AVAILABLE | CANCELLED DONE

* A
  DEADLINE: <2020-12-23 Wed>
* ROUTINE B
  DEADLINE: <2020-12-26 Sat>
* NEXT C
  DEADLINE: <2020-12-25 Fri>
* AVAILABLE D
  DEADLINE: <2020-12-24 Thu>
* E
  DEADLINE: <2020-12-22 Tue>
  1. M-< C-c C-c.
  2. C-c [.
  3. M-: (org-ql-search org-agenda-files '(and (todo "ROUTINE" "NEXT" "AVAILABLE") (deadline :to today) ) ) RET.
  4. M-: (org-ql-search org-agenda-files '(and (deadline :to today) (todo "ROUTINE" "NEXT" "AVAILABLE") ) ) RET.

Both show the same results:

  ROUTINE B  1d ago 
  NEXT C  2d ago 
  AVAILABLE D  3d ago 

alphapapa avatar Dec 27 '20 23:12 alphapapa

ok - thanks for the quick response! I'll follow up and try to repro with the rest of my config stripped out.

parsoj avatar Dec 28 '20 01:12 parsoj