emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Re-marking agenda entries, with advice on org-agenda-bulk-action in .emacs
@ 2011-10-02  9:13 netty hacky
  2011-10-02  9:28 ` netty hacky
  2012-04-24 22:07 ` Bastien
  0 siblings, 2 replies; 5+ messages in thread
From: netty hacky @ 2011-10-02  9:13 UTC (permalink / raw)
  To: emacs-orgmode

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

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.  I always do more than one bulk actions on the
same set of agenda entries, so having to re-mark them manually has been a
pain.  The org-agenda-bulk-mark-regexp command sort of helped, but I still
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.  It seems to work for me.  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?  Much appreciated.

(eval-after-load 'org-agenda
  '(defadvice org-agenda-bulk-action (around bulk-re-mark
                                             (&optional arg)
                                             activate)
     "Re-mark entries marked before action."
     (let ((entries (copy-sequence org-agenda-bulk-marked-entries)))
       ad-do-it
       (let (pos (cnt 0) (cntskip 0) (msg (current-message)))
         (dolist (e entries)
           (setq pos (text-property-any (point-min) (point-max)
'org-hd-marker e))
           (if (not pos)
               (setq cntskip (1+ cntskip))
             (goto-char pos)
             (call-interactively 'org-agenda-bulk-mark)
             (setq cnt (1+ cnt))))
         (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 experience.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Re-marking agenda entries, with advice on org-agenda-bulk-action in .emacs
  2011-10-02  9:13 Re-marking agenda entries, with advice on org-agenda-bulk-action in .emacs netty hacky
@ 2011-10-02  9:28 ` netty hacky
  2012-04-24 22:07 ` Bastien
  1 sibling, 0 replies; 5+ messages in thread
From: netty hacky @ 2011-10-02  9:28 UTC (permalink / raw)
  To: emacs-orgmode

My bad, didn't realized I wasn't sending email in plain txt.

On Sun, Oct 2, 2011 at 2:13 AM, netty hacky <netty.hacky@gmail.com> 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.  I always do more than one bulk actions on the
> same set of agenda entries, so having to re-mark them manually has been a
> pain.  The org-agenda-bulk-mark-regexp command sort of helped, but I still
> 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.  It seems to work for me.  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?  Much appreciated.
>
> (eval-after-load 'org-agenda
>   '(defadvice org-agenda-bulk-action (around bulk-re-mark
>                                              (&optional arg)
>                                              activate)
>      "Re-mark entries marked before action."
>      (let ((entries (copy-sequence org-agenda-bulk-marked-entries)))
>        ad-do-it
>        (let (pos (cnt 0) (cntskip 0) (msg (current-message)))
>          (dolist (e entries)
>            (setq pos (text-property-any (point-min) (point-max)
> 'org-hd-marker e))
>            (if (not pos)
>                (setq cntskip (1+ cntskip))
>              (goto-char pos)
>              (call-interactively 'org-agenda-bulk-mark)
>              (setq cnt (1+ cnt))))
>          (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 experience.
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Re-marking agenda entries, with advice on org-agenda-bulk-action in .emacs
  2011-10-02  9:13 Re-marking agenda entries, with advice on org-agenda-bulk-action in .emacs netty hacky
  2011-10-02  9:28 ` netty hacky
@ 2012-04-24 22:07 ` Bastien
  2015-03-03 18:12   ` Robert Pluim
  1 sibling, 1 reply; 5+ messages in thread
From: Bastien @ 2012-04-24 22:07 UTC (permalink / raw)
  To: netty hacky; +Cc: emacs-orgmode

netty hacky <netty.hacky@gmail.com> writes:

> The issue of re-marking agenda entries has been raised before:
> http://lists.gnu.org/archive/html/emacs-orgmode/2011-02/msg00200.html

From latest master, you can (setq org-agenda-persistent-marks t) to 
get persistent marks.

HTH,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Re-marking agenda entries, with advice on org-agenda-bulk-action in .emacs
  2012-04-24 22:07 ` Bastien
@ 2015-03-03 18:12   ` Robert Pluim
  2015-03-06 10:54     ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Pluim @ 2015-03-03 18:12 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Bastien <bzg@altern.org> writes:

> netty hacky <netty.hacky@gmail.com> writes:
>
>> The issue of re-marking agenda entries has been raised before:
>> http://lists.gnu.org/archive/html/emacs-orgmode/2011-02/msg00200.html
>
> From latest master, you can (setq org-agenda-persistent-marks t) to 
> get persistent marks.

Hi, there's a small issue with the texi description of this
feature. Fixed as follows:

* org.texi (Agenda commands): Correct reference to
  org-agenda-persistent-marks
---
 doc/misc/ChangeLog | 5 +++++
 doc/misc/org.texi  | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 448c7f2..c71355e 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-03  Robert Pluim  <rpluim@gmail.com>
+
+	* org.texi (Agenda commands): Correct reference to
+	org-agenda-persistent-marks
+
 2015-02-25  Tassilo Horn  <tsdh@gnu.org>
 
 	* reftex.texi (Multifile Documents): Document
diff --git a/doc/misc/org.texi b/doc/misc/org.texi
index 2cb80ab..63eacef 100644
--- a/doc/misc/org.texi
+++ b/doc/misc/org.texi
@@ -8995,7 +8995,7 @@ Bulk action: act on all marked entries in the agenda.  This will prompt for
 another key to select the action to be applied.  The prefix arg to @kbd{B}
 will be passed through to the @kbd{s} and @kbd{d} commands, to bulk-remove
 these special timestamps.  By default, marks are removed after the bulk.  If
-you want them to persist, set @code{org-agenda-bulk-persistent-marks} to
+you want them to persist, set @code{org-agenda-persistent-marks} to
 @code{t} or hit @kbd{p} at the prompt.
 
 @table @kbd
-- 
2.1.4

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Re-marking agenda entries, with advice on org-agenda-bulk-action in .emacs
  2015-03-03 18:12   ` Robert Pluim
@ 2015-03-06 10:54     ` Nicolas Goaziou
  0 siblings, 0 replies; 5+ messages in thread
From: Nicolas Goaziou @ 2015-03-06 10:54 UTC (permalink / raw)
  To: Robert Pluim; +Cc: Bastien, emacs-orgmode

Hello,

Robert Pluim <rpluim@gmail.com> writes:

> Hi, there's a small issue with the texi description of this
> feature. Fixed as follows:
>
> * org.texi (Agenda commands): Correct reference to
>   org-agenda-persistent-marks

Applied. Thank you.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-03-06 10:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-02  9:13 Re-marking agenda entries, with advice on org-agenda-bulk-action in .emacs netty hacky
2011-10-02  9:28 ` netty hacky
2012-04-24 22:07 ` Bastien
2015-03-03 18:12   ` Robert Pluim
2015-03-06 10:54     ` Nicolas Goaziou

Code repositories for project(s) associated with this 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).