[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] [bug] org-habit-show-all-today undefined
From: |
Eric S Fraga |
Subject: |
[O] [bug] org-habit-show-all-today undefined |
Date: |
Tue, 29 May 2012 13:07:31 +0930 |
User-agent: |
Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1.50 (gnu/linux) |
With the most recent update to org,
,----
| Author: Max Mikhanosha <address@hidden>
| Date: Mon May 28 14:55:32 2012 -0400
|
| Add ability to show all (even unscheduled) habits on today agenda, by
| setting `org-habit-show-all-today' to t.
|
| * lisp/org-agenda.el (defvar org-habit-show-all-today): new variable
| (org-agenda-get-scheduled): show all habits if user wants it
| * lisp/org-habit.el (defcustom org-habit-show-all-today): new variable
`----
I get the following error as soon as I try to view my agenda. I don't
use habits at all.
,----
| Debugger entered--Lisp error: (void-variable org-habit-show-all-today)
| (and todayp org-habit-show-all-today (setq did-habit-check-p t) (setq
habitp (and (functionp (quote org-is-habit-p)) (org-is-habit-p))))
| (or (and (< diff 0) (< (abs diff) org-scheduled-past-days) (and todayp (not
org-agenda-only-exact-dates))) (= diff 0) (and todayp org-habit-show-all-today
(setq did-habit-check-p t) (setq habitp (and (functionp (quote org-is-habit-p))
(org-is-habit-p)))))
| (if (or (and (< diff 0) (< (abs diff) org-scheduled-past-days) (and todayp
(not org-agenda-only-exact-dates))) (= diff 0) (and todayp
org-habit-show-all-today (setq did-habit-check-p t) (setq habitp (and
(functionp (quote org-is-habit-p)) (org-is-habit-p))))) (progn (save-excursion
(setq donep (member todo-state org-done-keywords)) (if (and donep (or
org-agenda-skip-scheduled-if-done (not (= diff 0)) (and (functionp ...)
(org-is-habit-p)))) (setq txt nil) (setq habitp (if did-habit-check-p habitp
(and (functionp ...) (org-is-habit-p)))) (setq category (org-get-category)
org-category-pos (get-text-property (point) (quote org-category-position))) (if
(not (re-search-backward "^\\*+[ ]+" nil t)) (setq txt
org-agenda-no-heading-message) (goto-char (match-end 0)) (setq pos1
(match-beginning 0)) (if habitp (if (or ... ...) (throw :skip nil)) (if (and
... ...) (throw :skip nil))) (setq tags (org-get-tags-at)) (setq head
(buffer-substring-no-properties (point) (progn ... ...))) (if (string-match "
\\([012]?[0-9]:[0-9][0-9]\\)" s) (setq timestr (concat ... " ")) (setq timestr
(quote time))) (setq txt (org-agenda-format-item (if ... ... ...) head category
tags (if ... nil timestr) nil habitp)))) (when txt (setq face (cond ((and ...
pastschedp) (quote org-scheduled-previously)) (todayp (quote
org-scheduled-today)) (t (quote org-scheduled))) habitp (and habitp
(org-habit-parse-todo))) (org-add-props txt props (quote undone-face) face
(quote face) (if donep (quote org-agenda-done) face) (quote org-marker)
(org-agenda-new-marker pos) (quote org-hd-marker) (org-agenda-new-marker pos1)
(quote type) (if pastschedp "past-scheduled" "scheduled") (quote date) (if
pastschedp d2 date) (quote priority) (if habitp (org-habit-get-priority habitp)
(+ 94 (- 5 diff) (org-get-priority txt))) (quote org-category) category (quote
org-category-position) org-category-pos (quote org-habit-p) habitp (quote
todo-state) todo-state) (push txt ee)))))
| (when (or (and (< diff 0) (< (abs diff) org-scheduled-past-days) (and
todayp (not org-agenda-only-exact-dates))) (= diff 0) (and todayp
org-habit-show-all-today (setq did-habit-check-p t) (setq habitp (and
(functionp (quote org-is-habit-p)) (org-is-habit-p))))) (save-excursion (setq
donep (member todo-state org-done-keywords)) (if (and donep (or
org-agenda-skip-scheduled-if-done (not (= diff 0)) (and (functionp (quote
org-is-habit-p)) (org-is-habit-p)))) (setq txt nil) (setq habitp (if
did-habit-check-p habitp (and (functionp (quote org-is-habit-p))
(org-is-habit-p)))) (setq category (org-get-category) org-category-pos
(get-text-property (point) (quote org-category-position))) (if (not
(re-search-backward "^\\*+[ ]+" nil t)) (setq txt
org-agenda-no-heading-message) (goto-char (match-end 0)) (setq pos1
(match-beginning 0)) (if habitp (if (or (not org-habit-show-habits) (and ...
org-habit-show-habits-only-for-today)) (throw :skip nil)) (if (and (or ... ...)
(setq mm ...)) (throw :skip nil))) (setq tags (org-get-tags-at)) (setq head
(buffer-substring-no-properties (point) (progn (skip-chars-forward "^\n")
(point)))) (if (string-match " \\([012]?[0-9]:[0-9][0-9]\\)" s) (setq timestr
(concat (substring s ...) " ")) (setq timestr (quote time))) (setq txt
(org-agenda-format-item (if (= diff 0) (car org-agenda-scheduled-leaders)
(format ... ...)) head category tags (if (not ...) nil timestr) nil habitp))))
(when txt (setq face (cond ((and (not habitp) pastschedp) (quote
org-scheduled-previously)) (todayp (quote org-scheduled-today)) (t (quote
org-scheduled))) habitp (and habitp (org-habit-parse-todo))) (org-add-props txt
props (quote undone-face) face (quote face) (if donep (quote org-agenda-done)
face) (quote org-marker) (org-agenda-new-marker pos) (quote org-hd-marker)
(org-agenda-new-marker pos1) (quote type) (if pastschedp "past-scheduled"
"scheduled") (quote date) (if pastschedp d2 date) (quote priority) (if habitp
(org-habit-get-priority habitp) (+ 94 (- 5 diff) (org-get-priority txt)))
(quote org-category) category (quote org-category-position) org-category-pos
(quote org-habit-p) habitp (quote todo-state) todo-state) (push txt ee))))
| (catch :skip (org-agenda-skip) (setq s (match-string 1) txt nil pos (1-
(match-beginning 1)) todo-state (save-match-data (org-get-todo-state)) show-all
(or (eq org-agenda-repeating-timestamp-show-all t) (member todo-state
org-agenda-repeating-timestamp-show-all)) d2 (org-time-string-to-absolute
(match-string 1) d1 (quote past) show-all (current-buffer) pos) diff (- d2 d1))
(setq pastschedp (and todayp (< diff 0))) (setq did-habit-check-p nil) (when
(or (and (< diff 0) (< (abs diff) org-scheduled-past-days) (and todayp (not
org-agenda-only-exact-dates))) (= diff 0) (and todayp org-habit-show-all-today
(setq did-habit-check-p t) (setq habitp (and (functionp (quote org-is-habit-p))
(org-is-habit-p))))) (save-excursion (setq donep (member todo-state
org-done-keywords)) (if (and donep (or org-agenda-skip-scheduled-if-done (not
(= diff 0)) (and (functionp ...) (org-is-habit-p)))) (setq txt nil) (setq
habitp (if did-habit-check-p habitp (and (functionp ...) (org-is-habit-p))))
(setq category (org-get-category) org-category-pos (get-text-property (point)
(quote org-category-position))) (if (not (re-search-backward "^\\*+[
]+" nil t)) (setq txt org-agenda-no-heading-message) (goto-char (match-end 0))
(setq pos1 (match-beginning 0)) (if habitp (if (or ... ...) (throw :skip nil))
(if (and ... ...) (throw :skip nil))) (setq tags (org-get-tags-at)) (setq head
(buffer-substring-no-properties (point) (progn ... ...))) (if (string-match "
\\([012]?[0-9]:[0-9][0-9]\\)" s) (setq timestr (concat ... " ")) (setq timestr
(quote time))) (setq txt (org-agenda-format-item (if ... ... ...) head category
tags (if ... nil timestr) nil habitp)))) (when txt (setq face (cond ((and ...
pastschedp) (quote org-scheduled-previously)) (todayp (quote
org-scheduled-today)) (t (quote org-scheduled))) habitp (and habitp
(org-habit-parse-todo))) (org-add-props txt props (quote undone-face) face
(quote face) (if donep (quote org-agenda-done) face) (quote org-marker)
(org-agenda-new-marker pos) (quote org-hd-marker) (org-agenda-new-marker pos1)
(quote type) (if pastschedp "past-scheduled" "scheduled") (quote date) (if
pastschedp d2 date) (quote priority) (if habitp (org-habit-get-priority habitp)
(+ 94 (- 5 diff) (org-get-priority txt))) (quote org-category) category (quote
org-category-position) org-category-pos (quote org-habit-p) habitp (quote
todo-state) todo-state) (push txt ee)))))
| (while (re-search-forward regexp nil t) (catch :skip (org-agenda-skip)
(setq s (match-string 1) txt nil pos (1- (match-beginning 1)) todo-state
(save-match-data (org-get-todo-state)) show-all (or (eq
org-agenda-repeating-timestamp-show-all t) (member todo-state
org-agenda-repeating-timestamp-show-all)) d2 (org-time-string-to-absolute
(match-string 1) d1 (quote past) show-all (current-buffer) pos) diff (- d2 d1))
(setq pastschedp (and todayp (< diff 0))) (setq did-habit-check-p nil) (when
(or (and (< diff 0) (< (abs diff) org-scheduled-past-days) (and todayp (not
org-agenda-only-exact-dates))) (= diff 0) (and todayp org-habit-show-all-today
(setq did-habit-check-p t) (setq habitp (and (functionp ...)
(org-is-habit-p))))) (save-excursion (setq donep (member todo-state
org-done-keywords)) (if (and donep (or org-agenda-skip-scheduled-if-done (not
...) (and ... ...))) (setq txt nil) (setq habitp (if did-habit-check-p habitp
(and ... ...))) (setq category (org-get-category) org-category-pos
(get-text-property (point) (quote org-category-position))) (if (not
(re-search-backward "^\\*+[ ]+" nil t)) (setq txt
org-agenda-no-heading-message) (goto-char (match-end 0)) (setq pos1
(match-beginning 0)) (if habitp (if ... ...) (if ... ...)) (setq tags
(org-get-tags-at)) (setq head (buffer-substring-no-properties ... ...)) (if
(string-match " \\([012]?[0-9]:[0-9][0-9]\\)" s) (setq timestr ...) (setq
timestr ...)) (setq txt (org-agenda-format-item ... head category tags ... nil
habitp)))) (when txt (setq face (cond (... ...) (todayp ...) (t ...)) habitp
(and habitp (org-habit-parse-todo))) (org-add-props txt props (quote
undone-face) face (quote face) (if donep (quote org-agenda-done) face) (quote
org-marker) (org-agenda-new-marker pos) (quote org-hd-marker)
(org-agenda-new-marker pos1) (quote type) (if pastschedp "past-scheduled"
"scheduled") (quote date) (if pastschedp d2 date) (quote priority) (if habitp
(org-habit-get-priority habitp) (+ 94 ... ...)) (quote org-category) category
(quote org-category-position) org-category-pos (quote org-habit-p) habitp
(quote todo-state) todo-state) (push txt ee))))))
| (let* ((props (list (quote org-not-done-regexp) org-not-done-regexp (quote
org-todo-regexp) org-todo-regexp (quote org-complex-heading-regexp)
org-complex-heading-regexp (quote done-face) (quote org-agenda-done) (quote
mouse-face) (quote highlight) (quote help-echo) (format "mouse-2 or RET jump to
org file %s" (abbreviate-file-name buffer-file-name)))) (regexp
org-scheduled-time-regexp) (todayp (org-agenda-todayp date)) (d1
(calendar-absolute-from-gregorian date)) mm (deadline-position-alist (mapcar
(lambda (a) (and (setq mm (get-text-property 0 ... a)) (cons (marker-position
mm) a))) deadline-results)) d2 diff pos pos1 category org-category-pos tags
donep ee txt head pastschedp todo-state face timestr s habitp show-all
did-habit-check-p) (goto-char (point-min)) (while (re-search-forward regexp nil
t) (catch :skip (org-agenda-skip) (setq s (match-string 1) txt nil pos (1-
(match-beginning 1)) todo-state (save-match-data (org-get-todo-state)) show-all
(or (eq org-agenda-repeating-timestamp-show-all t) (member todo-state
org-agenda-repeating-timestamp-show-all)) d2 (org-time-string-to-absolute
(match-string 1) d1 (quote past) show-all (current-buffer) pos) diff (- d2 d1))
(setq pastschedp (and todayp (< diff 0))) (setq did-habit-check-p nil) (when
(or (and (< diff 0) (< (abs diff) org-scheduled-past-days) (and todayp (not
org-agenda-only-exact-dates))) (= diff 0) (and todayp org-habit-show-all-today
(setq did-habit-check-p t) (setq habitp (and ... ...)))) (save-excursion (setq
donep (member todo-state org-done-keywords)) (if (and donep (or
org-agenda-skip-scheduled-if-done ... ...)) (setq txt nil) (setq habitp (if
did-habit-check-p habitp ...)) (setq category (org-get-category)
org-category-pos (get-text-property ... ...)) (if (not ...) (setq txt
org-agenda-no-heading-message) (goto-char ...) (setq pos1 ...) (if habitp ...
...) (setq tags ...) (setq head ...) (if ... ... ...) (setq txt ...))) (when
txt (setq face (cond ... ... ...) habitp (and habitp ...)) (org-add-props txt
props (quote undone-face) face (quote face) (if donep ... face) (quote
org-marker) (org-agenda-new-marker pos) (quote org-hd-marker)
(org-agenda-new-marker pos1) (quote type) (if pastschedp "past-scheduled"
"scheduled") (quote date) (if pastschedp d2 date) (quote priority) (if habitp
... ...) (quote org-category) category (quote org-category-position)
org-category-pos (quote org-habit-p) habitp (quote todo-state) todo-state)
(push txt ee)))))) (nreverse ee))
| org-agenda-get-scheduled(nil)
| (setq rtn (org-agenda-get-scheduled deadline-results))
| (cond ((and (eq arg :todo) (equal date (calendar-gregorian-from-absolute
(org-today)))) (setq rtn (org-agenda-get-todos)) (setq results (append results
rtn))) ((eq arg :timestamp) (setq rtn (org-agenda-get-blocks)) (setq results
(append results rtn)) (setq rtn (org-agenda-get-timestamps deadline-results))
(setq results (append results rtn))) ((eq arg :sexp) (setq rtn
(org-agenda-get-sexps)) (setq results (append results rtn))) ((eq arg
:scheduled) (setq rtn (org-agenda-get-scheduled deadline-results)) (setq
results (append results rtn))) ((eq arg :closed) (setq rtn
(org-agenda-get-progress)) (setq results (append results rtn))) ((eq arg
:deadline) (setq rtn (org-agenda-get-deadlines)) (setq deadline-results
(copy-sequence rtn)) (setq results (append results rtn))))
| (while (setq arg (pop args)) (cond ((and (eq arg :todo) (equal date
(calendar-gregorian-from-absolute (org-today)))) (setq rtn
(org-agenda-get-todos)) (setq results (append results rtn))) ((eq arg
:timestamp) (setq rtn (org-agenda-get-blocks)) (setq results (append results
rtn)) (setq rtn (org-agenda-get-timestamps deadline-results)) (setq results
(append results rtn))) ((eq arg :sexp) (setq rtn (org-agenda-get-sexps)) (setq
results (append results rtn))) ((eq arg :scheduled) (setq rtn
(org-agenda-get-scheduled deadline-results)) (setq results (append results
rtn))) ((eq arg :closed) (setq rtn (org-agenda-get-progress)) (setq results
(append results rtn))) ((eq arg :deadline) (setq rtn
(org-agenda-get-deadlines)) (setq deadline-results (copy-sequence rtn)) (setq
results (append results rtn)))))
| (save-restriction (if org-agenda-restrict (narrow-to-region
org-agenda-restrict-begin org-agenda-restrict-end) (widen)) (while (setq arg
(pop args)) (cond ((and (eq arg :todo) (equal date
(calendar-gregorian-from-absolute (org-today)))) (setq rtn
(org-agenda-get-todos)) (setq results (append results rtn))) ((eq arg
:timestamp) (setq rtn (org-agenda-get-blocks)) (setq results (append results
rtn)) (setq rtn (org-agenda-get-timestamps deadline-results)) (setq results
(append results rtn))) ((eq arg :sexp) (setq rtn (org-agenda-get-sexps)) (setq
results (append results rtn))) ((eq arg :scheduled) (setq rtn
(org-agenda-get-scheduled deadline-results)) (setq results (append results
rtn))) ((eq arg :closed) (setq rtn (org-agenda-get-progress)) (setq results
(append results rtn))) ((eq arg :deadline) (setq rtn
(org-agenda-get-deadlines)) (setq deadline-results (copy-sequence rtn)) (setq
results (append results rtn))))))
| (save-excursion (save-restriction (if org-agenda-restrict (narrow-to-region
org-agenda-restrict-begin org-agenda-restrict-end) (widen)) (while (setq arg
(pop args)) (cond ((and (eq arg :todo) (equal date
(calendar-gregorian-from-absolute ...))) (setq rtn (org-agenda-get-todos))
(setq results (append results rtn))) ((eq arg :timestamp) (setq rtn
(org-agenda-get-blocks)) (setq results (append results rtn)) (setq rtn
(org-agenda-get-timestamps deadline-results)) (setq results (append results
rtn))) ((eq arg :sexp) (setq rtn (org-agenda-get-sexps)) (setq results (append
results rtn))) ((eq arg :scheduled) (setq rtn (org-agenda-get-scheduled
deadline-results)) (setq results (append results rtn))) ((eq arg :closed) (setq
rtn (org-agenda-get-progress)) (setq results (append results rtn))) ((eq arg
:deadline) (setq rtn (org-agenda-get-deadlines)) (setq deadline-results
(copy-sequence rtn)) (setq results (append results rtn)))))))
| (let ((case-fold-search nil)) (save-excursion (save-restriction (if
org-agenda-restrict (narrow-to-region org-agenda-restrict-begin
org-agenda-restrict-end) (widen)) (while (setq arg (pop args)) (cond ((and (eq
arg :todo) (equal date ...)) (setq rtn (org-agenda-get-todos)) (setq results
(append results rtn))) ((eq arg :timestamp) (setq rtn (org-agenda-get-blocks))
(setq results (append results rtn)) (setq rtn (org-agenda-get-timestamps
deadline-results)) (setq results (append results rtn))) ((eq arg :sexp) (setq
rtn (org-agenda-get-sexps)) (setq results (append results rtn))) ((eq arg
:scheduled) (setq rtn (org-agenda-get-scheduled deadline-results)) (setq
results (append results rtn))) ((eq arg :closed) (setq rtn
(org-agenda-get-progress)) (setq results (append results rtn))) ((eq arg
:deadline) (setq rtn (org-agenda-get-deadlines)) (setq deadline-results
(copy-sequence rtn)) (setq results (append results rtn))))))))
| (save-current-buffer (set-buffer buffer) (unless (derived-mode-p (quote
org-mode)) (error "Agenda file %s is not in `org-mode'" file)) (let
((case-fold-search nil)) (save-excursion (save-restriction (if
org-agenda-restrict (narrow-to-region org-agenda-restrict-begin
org-agenda-restrict-end) (widen)) (while (setq arg (pop args)) (cond ((and ...
...) (setq rtn ...) (setq results ...)) ((eq arg :timestamp) (setq rtn ...)
(setq results ...) (setq rtn ...) (setq results ...)) ((eq arg :sexp) (setq rtn
...) (setq results ...)) ((eq arg :scheduled) (setq rtn ...) (setq results
...)) ((eq arg :closed) (setq rtn ...) (setq results ...)) ((eq arg :deadline)
(setq rtn ...) (setq deadline-results ...) (setq results ...))))))) results)
| (with-current-buffer buffer (unless (derived-mode-p (quote org-mode))
(error "Agenda file %s is not in `org-mode'" file)) (let ((case-fold-search
nil)) (save-excursion (save-restriction (if org-agenda-restrict
(narrow-to-region org-agenda-restrict-begin org-agenda-restrict-end) (widen))
(while (setq arg (pop args)) (cond ((and ... ...) (setq rtn ...) (setq results
...)) ((eq arg :timestamp) (setq rtn ...) (setq results ...) (setq rtn ...)
(setq results ...)) ((eq arg :sexp) (setq rtn ...) (setq results ...)) ((eq arg
:scheduled) (setq rtn ...) (setq results ...)) ((eq arg :closed) (setq rtn ...)
(setq results ...)) ((eq arg :deadline) (setq rtn ...) (setq deadline-results
...) (setq results ...))))))) results)
| (if (not buffer) (list (format "ORG-AGENDA-ERROR: No such org-file %s"
file)) (with-current-buffer buffer (unless (derived-mode-p (quote org-mode))
(error "Agenda file %s is not in `org-mode'" file)) (let ((case-fold-search
nil)) (save-excursion (save-restriction (if org-agenda-restrict
(narrow-to-region org-agenda-restrict-begin org-agenda-restrict-end) (widen))
(while (setq arg (pop args)) (cond (... ... ...) (... ... ... ... ...) (... ...
...) (... ... ...) (... ... ...) (... ... ... ...)))))) results))
| (let* ((org-startup-folded nil) (org-startup-align-all-tables nil) (buffer
(if (file-exists-p file) (org-get-agenda-file-buffer file) (error "No such file
%s" file))) arg results rtn deadline-results) (if (not buffer) (list (format
"ORG-AGENDA-ERROR: No such org-file %s" file)) (with-current-buffer buffer
(unless (derived-mode-p (quote org-mode)) (error "Agenda file %s is not in
`org-mode'" file)) (let ((case-fold-search nil)) (save-excursion
(save-restriction (if org-agenda-restrict (narrow-to-region
org-agenda-restrict-begin org-agenda-restrict-end) (widen)) (while (setq arg
...) (cond ... ... ... ... ... ...))))) results)))
| org-agenda-get-day-entries("~/s/notes/notes.org" (5 29 2012) :deadline
:scheduled :timestamp)
`----
thanks,
eric
--
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.1.50.1 + Ma Gnus v0.6
- [O] [bug] org-habit-show-all-today undefined,
Eric S Fraga <=