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
  1f49e9fdfd.

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

TINYCHANGE
This commit is contained in:
Michael Strey 2016-04-08 14:03:30 +02:00 committed by Nicolas Goaziou
parent ea98632e3b
commit 0fac70ea89
1 changed files with 13 additions and 12 deletions

View File

@ -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)))