emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bernt Hansen <bernt@norang.ca>
To: emacs-orgmode@gnu.org
Subject: [PATCH] agenda filter: Treat no effort value the same as 0
Date: Mon, 10 Nov 2008 16:22:12 -0500	[thread overview]
Message-ID: <871vxjp98b.fsf@gollum.intra.norang.ca> (raw)

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	other threads:[~2008-11-10 21:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-10 21:22 Bernt Hansen [this message]
2008-11-11  5:57 ` [PATCH] agenda filter: Treat no effort value the same as 0 Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871vxjp98b.fsf@gollum.intra.norang.ca \
    --to=bernt@norang.ca \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).