Browse Source

org.el: Fix bug from switch to lexical binding

* lisp/org.el (org-check-dates-range): Fix a bug introduces with the
  switch to lexical binding in commit
  1f49e9fdfd8b527377b5592bd65ad3be6abb9e6a.

This change fixed the following bug:  C-c \ D leads to error message "Symbol's value as variable is void: start-date".

TINYCHANGE
Michael Strey 9 years ago
parent
commit
0fac70ea89
1 changed files with 13 additions and 12 deletions
  1. 13 12
      lisp/org.el

+ 13 - 12
lisp/org.el

@@ -17476,18 +17476,19 @@ both scheduled and deadline timestamps."
   (let ((case-fold-search nil)
 	(regexp (org-re-timestamp 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))
-	       (not (time-less-p
-		     (org-time-string-to-time match)
-		     (org-time-string-to-time start-date)))
-	       (time-less-p
-		(org-time-string-to-time match)
-		(org-time-string-to-time end-date)))))))
+	 (let ((type org-ts-type))
+	   (lambda ()
+	     (let ((match (match-string 1)))
+	       (and
+		(if (memq 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 start-date)))
+		(time-less-p
+		 (org-time-string-to-time match)
+		 (org-time-string-to-time end-date))))))))
     (message "%d entries between %s and %s"
 	     (org-occur regexp nil callback) start-date end-date)))