From: Nick Dokos <nicholas.dokos@hp.com>
To: Madan Ramakrishnan <madanr79@gmail.com>
Cc: emacs-orgmode@gnu.org
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 [thread overview]
Message-ID: <17813.1334558185@alphaville> (raw)
In-Reply-To: Message from Madan Ramakrishnan <madanr79@gmail.com> of "Sun, 15 Apr 2012 22:29:49 EDT." <CAHhKTtEhmD+FGCRwvrs1qD=HiVHjDM=dsrj_eU1cNdPKu=EBJQ@mail.gmail.com>
Madan Ramakrishnan <madanr79@gmail.com> 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
next prev parent reply other threads:[~2012-04-16 6:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-16 2:29 [PATCH] Agenda: Fix org-agenda-bulk-toggle when point is at already marked item Madan Ramakrishnan
2012-04-16 6:36 ` Nick Dokos [this message]
2012-04-16 12:07 ` Madan Ramakrishnan
2012-04-16 14:07 ` Nick Dokos
2012-04-20 12:55 ` Bastien
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=17813.1334558185@alphaville \
--to=nicholas.dokos@hp.com \
--cc=emacs-orgmode@gnu.org \
--cc=madanr79@gmail.com \
/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).