From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: [PATCH] agenda filter: Treat no effort value the same as 0 Date: Mon, 10 Nov 2008 16:22:12 -0500 Message-ID: <871vxjp98b.fsf@gollum.intra.norang.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KzeDB-00076t-MV for emacs-orgmode@gnu.org; Mon, 10 Nov 2008 16:22:17 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KzeDA-00076f-MJ for emacs-orgmode@gnu.org; Mon, 10 Nov 2008 16:22:17 -0500 Received: from [199.232.76.173] (port=56038 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KzeDA-00076a-Hh for emacs-orgmode@gnu.org; Mon, 10 Nov 2008 16:22:16 -0500 Received: from mho-02-bos.mailhop.org ([63.208.196.179]:54511) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KzeDA-0003Ul-70 for emacs-orgmode@gnu.org; Mon, 10 Nov 2008 16:22:16 -0500 Received: from cpe000102d0fe75-cm0012256ecbde.cpe.net.cable.rogers.com ([99.239.148.180] helo=mail.norang.ca) by mho-02-bos.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1KzeD9-000HW0-BB for emacs-orgmode@gnu.org; Mon, 10 Nov 2008 21:22:15 +0000 Received: from gollum.intra.norang.ca (gollum.intra.norang.ca [192.168.1.5]) by mail.norang.ca (8.13.8/8.13.8/Debian-3) with ESMTP id mAALMCjI007929 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 10 Nov 2008 16:22:13 -0500 Received: from gollum.intra.norang.ca (localhost [127.0.0.1]) by gollum.intra.norang.ca (8.14.3/8.14.3/Debian-5) with ESMTP id mAALMC5R012062 for ; Mon, 10 Nov 2008 16:22:12 -0500 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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