Explorar o código

org-agenda.el: Fix the declaration/check of org-habit variables

* org-agenda.el (org-habit-show-all-today): Only use defvar
to silent the byte-compiler.
(org-agenda-get-scheduled): Check whether some org-habit.el
options have been defined.

Thanks to Robert Horn for reporting this.
Bastien Guerry %!s(int64=12) %!d(string=hai) anos
pai
achega
a67676809c
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      lisp/org-agenda.el

+ 3 - 1
lisp/org-agenda.el

@@ -90,7 +90,7 @@
 (defvar org-mobile-force-id-on-agenda-items)  ; defined in org-mobile.el
 (defvar org-habit-show-habits)                ; defined in org-habit.el
 (defvar org-habit-show-habits-only-for-today)
-(defvar org-habit-show-all-today nil)
+(defvar org-habit-show-all-today)
 
 ;; Defined somewhere in this file, but used before definition.
 (defvar org-agenda-buffer-name "*Org Agenda*")
@@ -5706,6 +5706,7 @@ FRACTION is what fraction of the head-warning time has passed."
 		  ;; org-is-habit-p uses org-entry-get, which is expansive
 		  ;; so we go extra mile to only call it once
 		  (and todayp
+		       (boundp 'org-habit-show-all-today)
 		       org-habit-show-all-today
 		       (setq did-habit-check-p t)
 		       (setq habitp (and (functionp 'org-is-habit-p)
@@ -5730,6 +5731,7 @@ FRACTION is what fraction of the head-warning time has passed."
 		(if habitp
 		    (if (or (not org-habit-show-habits)
 			    (and (not todayp)
+				 (boundp 'org-habit-show-habits-only-for-today)
 				 org-habit-show-habits-only-for-today))
 			(throw :skip nil))
 		  (if (and