From mboxrd@z Thu Jan 1 00:00:00 1970 From: netty hacky Subject: Re: Re-marking agenda entries, with advice on org-agenda-bulk-action in .emacs Date: Sun, 2 Oct 2011 02:28:51 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:33467) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAILu-0001Md-SM for emacs-orgmode@gnu.org; Sun, 02 Oct 2011 05:28:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RAILt-0001Wq-Cy for emacs-orgmode@gnu.org; Sun, 02 Oct 2011 05:28:54 -0400 Received: from mail-vw0-f41.google.com ([209.85.212.41]:36159) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAILt-0001Wm-9G for emacs-orgmode@gnu.org; Sun, 02 Oct 2011 05:28:53 -0400 Received: by vws16 with SMTP id 16so2715708vws.0 for ; Sun, 02 Oct 2011 02:28:52 -0700 (PDT) In-Reply-To: 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: emacs-orgmode@gnu.org My bad, didn't realized I wasn't sending email in plain txt. On Sun, Oct 2, 2011 at 2:13 AM, netty hacky wrote: > Hello, > > The issue of re-marking agenda entries has been raised before: > http://lists.gnu.org/archive/html/emacs-orgmode/2011-02/msg00200.html > > I am facing the same problem.=A0 I always do more than one bulk actions o= n the > same set of agenda entries, so having to re-mark them manually has been a > pain.=A0 The org-agenda-bulk-mark-regexp command sort of helped, but I st= ill > prefer the Dired behavior of retaining the mark after action is performed= , > (typing one 'U' is much less keystroke than any manual re-marking). > > Anyway, I put the following piece of code in .emacs to give me the Dired > like behavior.=A0 It seems to work for me.=A0 Since I'm new to Emacs Lisp= and > this is the 2nd day I'm hacking Org-mode code, could anyone help spot > anything I did stupid here that may shoot me in the foot?=A0 Much appreci= ated. > > (eval-after-load 'org-agenda > =A0 '(defadvice org-agenda-bulk-action (around bulk-re-mark > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (&optional arg= ) > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 activate) > =A0=A0=A0=A0 "Re-mark entries marked before action." > =A0=A0=A0=A0 (let ((entries (copy-sequence org-agenda-bulk-marked-entries= ))) > =A0=A0=A0=A0=A0=A0 ad-do-it > =A0=A0=A0=A0=A0=A0 (let (pos (cnt 0) (cntskip 0) (msg (current-message))) > =A0=A0=A0=A0=A0=A0=A0=A0 (dolist (e entries) > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (setq pos (text-property-any (point-min) (= point-max) > 'org-hd-marker e)) > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (if (not pos) > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (setq cntskip (1+ cntskip)) > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (goto-char pos) > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (call-interactively 'org-agenda-bulk= -mark) > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (setq cnt (1+ cnt)))) > =A0=A0=A0=A0=A0=A0=A0=A0 (message "%s (%d entries re-marked, %d skipped)"= msg cnt > cntskip))))) > > Cheers, > Net > P.S. I would like to express my sincere gratitude to all who helped make > Org-mode such a beautiful piece of software and a life-changing experienc= e. >