emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] agenda filter: Treat no effort value the same as 0
@ 2008-11-10 21:22 Bernt Hansen
  2008-11-11  5:57 ` Carsten Dominik
  0 siblings, 1 reply; 2+ messages in thread
From: Bernt Hansen @ 2008-11-10 21:22 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] agenda filter: Treat no effort value the same as 0
  2008-11-10 21:22 [PATCH] agenda filter: Treat no effort value the same as 0 Bernt Hansen
@ 2008-11-11  5:57 ` Carsten Dominik
  0 siblings, 0 replies; 2+ messages in thread
From: Carsten Dominik @ 2008-11-11  5:57 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: emacs-orgmode

Applied, thanks.

- Carsten

On Nov 10, 2008, at 10:22 PM, Bernt Hansen wrote:

> 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
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-11-11  5:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-10 21:22 [PATCH] agenda filter: Treat no effort value the same as 0 Bernt Hansen
2008-11-11  5:57 ` Carsten Dominik

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).