From cb05b3a3d7015273335d07c88efd1edf7abcddef Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sat, 6 Feb 2016 00:19:02 +0100 Subject: [PATCH] Fix (void-variable d) error * lisp/org.el (org-check-before-date): (org-check-after-date): Ensure D enters the lexical scope. Reported-by: Eric S Fraga --- lisp/org.el | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 8deef609b..cce4f3a43 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -17419,14 +17419,15 @@ both scheduled and deadline timestamps." (defun org-check-before-date (d) "Check if there are deadlines or scheduled entries before date D." (interactive (list (org-read-date))) - (let ((case-fold-search nil) - (regexp (org-re-timestamp org-ts-type)) - (callback - `(lambda () + (let* ((case-fold-search nil) + (regexp (org-re-timestamp org-ts-type)) + (ts-type org-ts-type) + (callback + (lambda () (let ((match (match-string 1))) - (and ,(if (memq org-ts-type '(active inactive all)) - '(eq (org-element-type (org-element-context)) 'timestamp) - '(org-at-planning-p)) + (and (if (memq ts-type '(active inactive all)) + (eq (org-element-type (org-element-context)) 'timestamp) + (org-at-planning-p)) (time-less-p (org-time-string-to-time match) (org-time-string-to-time d))))))) @@ -17437,14 +17438,15 @@ both scheduled and deadline timestamps." (defun org-check-after-date (d) "Check if there are deadlines or scheduled entries after date D." (interactive (list (org-read-date))) - (let ((case-fold-search nil) - (regexp (org-re-timestamp org-ts-type)) - (callback - `(lambda () + (let* ((case-fold-search nil) + (regexp (org-re-timestamp org-ts-type)) + (ts-type org-ts-type) + (callback + (lambda () (let ((match (match-string 1))) - (and ,(if (memq org-ts-type '(active inactive all)) - '(eq (org-element-type (org-element-context)) 'timestamp) - '(org-at-planning-p)) + (and (if (memq ts-type '(active inactive all)) + (eq (org-element-type (org-element-context)) 'timestamp) + (org-at-planning-p)) (not (time-less-p (org-time-string-to-time match) (org-time-string-to-time d)))))))) -- 2.11.4.GIT