From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: [bug] org fails in org-sparse-tree for date filtering Date: Fri, 5 Feb 2016 09:10:23 +0000 Message-ID: <87wpqjttds.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRcPR-0006Ri-AJ for emacs-orgmode@gnu.org; Fri, 05 Feb 2016 04:10:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRcPO-0004jk-1I for emacs-orgmode@gnu.org; Fri, 05 Feb 2016 04:10:33 -0500 Received: from mail-db3on0142.outbound.protection.outlook.com ([157.55.234.142]:4992 helo=emea01-db3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRcPN-0004jP-MH for emacs-orgmode@gnu.org; Fri, 05 Feb 2016 04:10:29 -0500 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Hello, it's that time of year where I remove (i.e. archive) old entries in my various agenda files. One way I use to identify what I want to archive is to use org-sparse-tree, selecting [b]efore-date. If I do so, giving for instance "1 jan 2015" as the date, I get an error with backtrace in the attached file. Org is up to date from git. Thanks, eric -- : Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org release_8.3.3-548-g99697a --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename="backtrace.txt" Content-Transfer-Encoding: quoted-printable Debugger entered--Lisp error: (void-variable d) (org-time-string-to-time d) (time-less-p (org-time-string-to-time match) (org-time-string-to-time d)) (and (org-at-planning-p) (time-less-p (org-time-string-to-time match) (or= g-time-string-to-time d))) (let ((match (match-string 1))) (and (org-at-planning-p) (time-less-p (or= g-time-string-to-time match) (org-time-string-to-time d)))) (lambda nil (let ((match (match-string 1))) (and (org-at-planning-p) (tim= e-less-p (org-time-string-to-time match) (org-time-string-to-time d)))))() funcall((lambda nil (let ((match (match-string 1))) (and (org-at-planning= -p) (time-less-p (org-time-string-to-time match) (org-time-string-to-time d= )))))) (progn (funcall callback)) (unwind-protect (progn (funcall callback)) (set-match-data save-match-dat= a-internal (quote evaporate))) (let ((save-match-data-internal (match-data))) (unwind-protect (progn (fu= ncall callback)) (set-match-data save-match-data-internal (quote evaporate)= ))) (or (not callback) (let ((save-match-data-internal (match-data))) (unwind= -protect (progn (funcall callback)) (set-match-data save-match-data-interna= l (quote evaporate))))) (if (or (not callback) (let ((save-match-data-internal (match-data))) (un= wind-protect (progn (funcall callback)) (set-match-data save-match-data-int= ernal (quote evaporate))))) (progn (setq cnt (1+ cnt)) (if org-highlight-sp= arse-tree-matches (progn (org-highlight-new-match (match-beginning 0) (matc= h-end 0)))) (org-show-context (quote occur-tree)))) (while (re-search-forward regexp nil t) (backward-char) (if (or (not call= back) (let ((save-match-data-internal (match-data))) (unwind-protect (progn= (funcall callback)) (set-match-data save-match-data-internal (quote evapor= ate))))) (progn (setq cnt (1+ cnt)) (if org-highlight-sparse-tree-matches (= progn (org-highlight-new-match (match-beginning 0) (match-end 0)))) (org-sh= ow-context (quote occur-tree))))) (save-excursion (goto-char (point-min)) (if (or (not keep-previous) (not = org-occur-highlights)) (progn (org-overview))) (while (re-search-forward re= gexp nil t) (backward-char) (if (or (not callback) (let ((save-match-data-i= nternal (match-data))) (unwind-protect (progn (funcall callback)) (set-matc= h-data save-match-data-internal (quote evaporate))))) (progn (setq cnt (1+ = cnt)) (if org-highlight-sparse-tree-matches (progn (org-highlight-new-match= (match-beginning 0) (match-end 0)))) (org-show-context (quote occur-tree))= )))) (let ((cnt 0)) (save-excursion (goto-char (point-min)) (if (or (not keep-= previous) (not org-occur-highlights)) (progn (org-overview))) (while (re-se= arch-forward regexp nil t) (backward-char) (if (or (not callback) (let ((sa= ve-match-data-internal ...)) (unwind-protect (progn ...) (set-match-data sa= ve-match-data-internal ...)))) (progn (setq cnt (1+ cnt)) (if org-highlight= -sparse-tree-matches (progn (org-highlight-new-match ... ...))) (org-show-c= ontext (quote occur-tree)))))) (if org-remove-highlights-with-change (progn= (org-add-hook (quote before-change-functions) (quote org-remove-occur-high= lights) nil (quote local)))) (if org-sparse-tree-open-archived-trees nil (o= rg-hide-archived-subtrees (point-min) (point-max))) (run-hooks (quote org-o= ccur-hook)) (if (with-no-warnings (called-interactively-p (quote interactiv= e))) (progn (message "%d match(es) for regexp %s" cnt regexp))) cnt) org-occur("\\<\\(?:\\(?:DEADLINE\\|SCHEDULED\\):\\) *<\\([^>]+\\)>" nil (= lambda nil (let ((match (match-string 1))) (and (org-at-planning-p) (time-l= ess-p (org-time-string-to-time match) (org-time-string-to-time d)))))) (message "%d entries before %s" (org-occur regexp nil callback) d) (let ((case-fold-search nil) (regexp (org-re-timestamp org-ts-type)) (cal= lback (list (quote lambda) nil (list (quote let) (quote ((match ...))) (con= s (quote and) (cons (if ... ... ...) (quote ...))))))) (message "%d entries= before %s" (org-occur regexp nil callback) d)) org-check-before-date("2015-01-01") funcall-interactively(org-check-before-date "2015-01-01") call-interactively(org-check-before-date) (cond ((eql answer (quote 99)) (org-sparse-tree arg (car (cdr (memq type = (quote (nil all scheduled deadline active inactive closed))))))) ((eql answ= er (quote 100)) (call-interactively (quote org-check-deadlines))) ((eql ans= wer (quote 98)) (call-interactively (quote org-check-before-date))) ((eql a= nswer (quote 97)) (call-interactively (quote org-check-after-date))) ((eql = answer (quote 68)) (call-interactively (quote org-check-dates-range))) ((eq= l answer (quote 116)) (call-interactively (quote org-show-todo-tree))) ((eq= l answer (quote 84)) (org-show-todo-tree (quote (4)))) ((eql answer (quote = 109)) (call-interactively (quote org-match-sparse-tree))) ((memql answer (q= uote (112 80))) (let* ((kwd (completing-read "Property: " (mapcar (function= list) (org-buffer-property-keys)))) (value (completing-read "Value: " (map= car (function list) (org-property-values kwd))))) (if (string-match "\\`{.*= }\\'" value) nil (setq value (concat "\"" value "\""))) (org-match-sparse-t= ree arg (concat kwd "=3D" value)))) ((memql answer (quote (114 82 47))) (ca= ll-interactively (quote org-occur))) (t (user-error "No such sparse tree co= mmand \"%c\"" answer))) (let ((answer (read-char-exclusive))) (cond ((eql answer (quote 99)) (org= -sparse-tree arg (car (cdr (memq type (quote ...)))))) ((eql answer (quote = 100)) (call-interactively (quote org-check-deadlines))) ((eql answer (quote= 98)) (call-interactively (quote org-check-before-date))) ((eql answer (quo= te 97)) (call-interactively (quote org-check-after-date))) ((eql answer (qu= ote 68)) (call-interactively (quote org-check-dates-range))) ((eql answer (= quote 116)) (call-interactively (quote org-show-todo-tree))) ((eql answer (= quote 84)) (org-show-todo-tree (quote (4)))) ((eql answer (quote 109)) (cal= l-interactively (quote org-match-sparse-tree))) ((memql answer (quote (112 = 80))) (let* ((kwd (completing-read "Property: " (mapcar ... ...))) (value (= completing-read "Value: " (mapcar ... ...)))) (if (string-match "\\`{.*}\\'= " value) nil (setq value (concat "\"" value "\""))) (org-match-sparse-tree = arg (concat kwd "=3D" value)))) ((memql answer (quote (114 82 47))) (call-i= nteractively (quote org-occur))) (t (user-error "No such sparse tree comman= d \"%c\"" answer)))) org-sparse-tree(nil) funcall-interactively(org-sparse-tree nil) call-interactively(org-sparse-tree nil nil) command-execute(org-sparse-tree) --=-=-=--