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
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)
(org-time-string-to-time d)))
(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))))
(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)))))()
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-data-internal (quote evaporate)))
(let ((save-match-data-internal (match-data))) (unwind-protect (progn
(funcall 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-internal (quote evaporate)))))
(if (or (not callback) (let ((save-match-data-internal (match-data)))
(unwind-protect (progn (funcall callback)) (set-match-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))))
(while (re-search-forward regexp nil t) (backward-char) (if (or (not
callback) (let ((save-match-data-internal (match-data))) (unwind-protect (progn
(funcall callback)) (set-match-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)))))
(save-excursion (goto-char (point-min)) (if (or (not keep-previous) (not
org-occur-highlights)) (progn (org-overview))) (while (re-search-forward regexp
nil t) (backward-char) (if (or (not callback) (let ((save-match-data-internal
(match-data))) (unwind-protect (progn (funcall callback)) (set-match-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-search-forward regexp nil t) (backward-char) (if (or (not callback) (let
((save-match-data-internal ...)) (unwind-protect (progn ...) (set-match-data
save-match-data-internal ...)))) (progn (setq cnt (1+ cnt)) (if
org-highlight-sparse-tree-matches (progn (org-highlight-new-match ... ...)))
(org-show-context (quote occur-tree)))))) (if org-remove-highlights-with-change
(progn (org-add-hook (quote before-change-functions) (quote
org-remove-occur-highlights) nil (quote local)))) (if
org-sparse-tree-open-archived-trees nil (org-hide-archived-subtrees (point-min)
(point-max))) (run-hooks (quote org-occur-hook)) (if (with-no-warnings
(called-interactively-p (quote interactive))) (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-less-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))
(callback (list (quote lambda) nil (list (quote let) (quote ((match ...)))
(cons (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 answer
(quote 100)) (call-interactively (quote org-check-deadlines))) ((eql answer
(quote 98)) (call-interactively (quote org-check-before-date))) ((eql answer
(quote 97)) (call-interactively (quote org-check-after-date))) ((eql answer
(quote 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))
(call-interactively (quote org-match-sparse-tree))) ((memql answer (quote (112
80))) (let* ((kwd (completing-read "Property: " (mapcar (function list)
(org-buffer-property-keys)))) (value (completing-read "Value: " (mapcar
(function list) (org-property-values kwd))))) (if (string-match "\\`{.*}\\'"
value) nil (setq value (concat "\"" value "\""))) (org-match-sparse-tree arg
(concat kwd "=" value)))) ((memql answer (quote (114 82 47)))
(call-interactively (quote org-occur))) (t (user-error "No such sparse tree
command \"%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 (quote
97)) (call-interactively (quote org-check-after-date))) ((eql answer (quote
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)) (call-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 "="
value)))) ((memql answer (quote (114 82 47))) (call-interactively (quote
org-occur))) (t (user-error "No such sparse tree command \"%c\"" answer))))
org-sparse-tree(nil)
funcall-interactively(org-sparse-tree nil)
call-interactively(org-sparse-tree nil nil)
command-execute(org-sparse-tree)