emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Madan Ramakrishnan <madanr79@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Agenda: Fix org-agenda-bulk-toggle when point is at already marked item
Date: Sun, 15 Apr 2012 22:29:49 -0400	[thread overview]
Message-ID: <CAHhKTtEhmD+FGCRwvrs1qD=HiVHjDM=dsrj_eU1cNdPKu=EBJQ@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1011 bytes --]

* 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

[-- Attachment #2: Type: text/html, Size: 1448 bytes --]

             reply	other threads:[~2012-04-16  2:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-16  2:29 Madan Ramakrishnan [this message]
2012-04-16  6:36 ` [PATCH] Agenda: Fix org-agenda-bulk-toggle when point is at already marked item Nick Dokos
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='CAHhKTtEhmD+FGCRwvrs1qD=HiVHjDM=dsrj_eU1cNdPKu=EBJQ@mail.gmail.com' \
    --to=madanr79@gmail.com \
    --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).