emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] [PATCH] agenda filter: Treat no effort value the same as 0


From: Bernt Hansen
Subject: [Orgmode] [PATCH] agenda filter: Treat no effort value the same as 0
Date: Mon, 10 Nov 2008 16:22:12 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

This changes the default value for Effort during agenda filtering so
that an undefined Effort value is treated as 0 instead of nil.  Tasks
with no effort defined now return zero effort when selecting tasks for
the filter.

There was effectively no way to select 'tasks with no effort defined'
using the agenda effort filter.  The '<' operator is interpreted as
'<=' and the default effort selection defined in
org-agenda-filter-by-tag starts with zero ("0 0:10 ...") so this
change just treats tasks with no effort defined the same as tasks with
an effort of 0.

This allows fast selection of NEXT tasks with no effort defined.
Column view with follow-mode active in the agenda is great for quickly
filling in the agenda estimated effort values for tasks.  Just display
your Next tasks, then / 0 to select tasks with no effort and enter
column mode (C-c C-x C-c) and fill in your effort values with the
quick keys (0-9) for all of the tasks that have blanks in the effort
column.
---

Carsten: This commit is available at git://git.norang.ca/org-mode on the
         branch 'agenda-no-effort-is-zero'

-Bernt

 lisp/org-agenda.el |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index a2e1415..371e7d9 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4305,10 +4305,10 @@ E looks line \"+<2:25\"."
 
 (defun org-agenda-compare-effort (op value)
   "Compare the effort of the current line with VALUE, using OP.
-If the line does not have an effort defined, return nil."
+If the line does not have an effort defined, return zero (0)."
   (let ((eff (get-text-property (point) 'effort-minutes)))
     (if (not eff)
-       nil ; we don't have an effort defined
+       0 ; we don't have an effort defined, assume 0
       (funcall op eff value))))
 
 (defun org-agenda-filter-apply (filter)
-- 
1.6.0.4.608.ga9645





reply via email to

[Prev in Thread] Current Thread [Next in Thread]