From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: [PATCH] Agenda: Fix org-agenda-bulk-toggle when point is at already marked item Date: Mon, 16 Apr 2012 02:36:25 -0400 Message-ID: <17813.1334558185@alphaville> References: Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([208.118.235.92]:38027) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJfYJ-00057T-Cs for emacs-orgmode@gnu.org; Mon, 16 Apr 2012 02:36:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SJfYH-0008G1-LL for emacs-orgmode@gnu.org; Mon, 16 Apr 2012 02:36:42 -0400 Received: from g6t0185.atlanta.hp.com ([15.193.32.62]:35385) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJfYH-0008D4-GG for emacs-orgmode@gnu.org; Mon, 16 Apr 2012 02:36:41 -0400 In-Reply-To: Message from Madan Ramakrishnan of "Sun, 15 Apr 2012 22:29:49 EDT." List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Madan Ramakrishnan Cc: emacs-orgmode@gnu.org Madan Ramakrishnan 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