emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] [PATCH] Agenda: Fix org-agenda-bulk-toggle when point is at alre


From: Nick Dokos
Subject: Re: [O] [PATCH] Agenda: Fix org-agenda-bulk-toggle when point is at already marked item
Date: Mon, 16 Apr 2012 02:36:25 -0400

Madan Ramakrishnan <address@hidden> wrote:

> * lisp/org-agenda.el (org-agenda-bulk-mark): truly make arg optional
> as advertised by the function
> 
> Problem here was that org-agenda-bulk-toggle calls org-agenda-bulk-mark
> with no parameters; however, the (max arg 1) call inside
> org-agenda-bulk-mark
> will fail with no parameter.  Change the max to an or and all is well.
> 
> This is my first patch for org so apologies for any inadvertent missteps
> 
> TINYCHANGE
> ---
>  lisp/org-agenda.el |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
> index 0ffaadb..4e9473d 100644
> --- a/lisp/org-agenda.el
> +++ b/lisp/org-agenda.el
> @@ -8299,7 +8299,7 @@ This is a command that has to be installed in
> `calendar-mode-map'."
>  (defun org-agenda-bulk-mark (&optional arg)
>    "Mark the entry at point for future bulk action."
>    (interactive "p")
> -  (dotimes (i (max arg 1))
> +  (dotimes (i (or arg 1))
>      (unless (org-get-at-bol 'org-agenda-diary-link)
>        (let* ((m (org-get-at-bol 'org-hd-marker))
>       ov)
> -- 
> 1.7.9.2
> 

I presume arg can be negative or zero.

If arg is e.g. -3

(max arg 1) -> 1
(or arg 1)  -> -3

so your patch changes the behavior of the function
in these cases.

Nick



reply via email to

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