[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Scatter-gather idea
Re: [O] Scatter-gather idea
Thu, 06 Apr 2017 15:40:40 -0400
mu4e 0.9.19; emacs 25.1.1
I am sympathetic to not wanting to use tags here. It would be tedious to
tag them all, and then remove them (my opinion of course;). Here is some
code that you can "mark" headlines with a speed command (M on a headline
start) or interactively. This just stores a marker to the headline in a
global variable. Then, use M-x scatter-gather to put them all into one
temporary buffer. From there you can manipulate them any way you want,
and save the result anyway you want. You could modify scatter-gather to
either copy or move the headlines.
You could also use overlays to indicate a headline had been marked, and
make some convenience functions to remove headlines from the list, but I
leave those for exercises ;)
This code is lightly tested.
(defvar scatter-gather-markers '()
"List of markers where headlines are for gathering.")
(defun scatter-gather-mark-heading ()
"Add the current headline to `scatter-gather-markers'."
(add-to-list 'scatter-gather-markers (point-marker)))
(defun scatter-gather ()
"Gather marked headlines into a temporary buffer"
(switch-to-buffer-other-window (get-buffer-create "*scatter-gather*"))
(loop for marker in (reverse scatter-gather-markers)
(insert (with-current-buffer (marker-buffer marker)
(goto-char (marker-position marker))
(buffer-substring (point) (mark))))))
(setq scatter-gather-markers '())))
(add-to-list 'org-speed-commands-user (cons "M" 'scatter-gather-mark-heading))
Nick Dokos writes:
> Bob Newell <address@hidden> writes:
>>>> mark them with tags, and do org-tags-view. Or, you can use regex or other
>>>> criteria if you like.
>>> That was my first thought too: I didn't think any extra functionality is
>> I looked into this earlier but agenda bulk marking doesn't seem to work
>> in an arbitrary org-mode buffer; it must be an agenda buffer, and you
>> can only mark certain entries.
>> The tag idea may be the best way. Thanks to all for the replies.
> Yes, sorry: I was talking about tags, not about agenda bulk-marking. Although
> can add an arbitrary org file to the agend with `C-c [', do what you need to
> and then remove it with `C-c ]'.
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
Re: [O] Scatter-gather idea, Bingo, 2017/04/01
Re: [O] Bug: Can't execute C code block from remote directory [9.0.5 (release_9.0.5-401-g86ff11 @ /Users/xcy/src/org-mode/lisp/)], Chunyang Xu, 2017/04/03
- [O] Bug: Can't execute C code block from remote directory [9.0.5 (release_9.0.5-401-g86ff11 @ /Users/xcy/src/org-mode/lisp/)], Chunyang Xu, 2017/04/01
- [O] Scatter-gather idea, Bob Newell, 2017/04/01
- Re: [O] Scatter-gather idea, John Kitchin, 2017/04/01
- Re: [O] Scatter-gather idea, Bob Newell, 2017/04/01
- Re: [O] Scatter-gather idea, Samuel Wales, 2017/04/02
- Re: [O] Scatter-gather idea, Bob Newell, 2017/04/03
- Re: [O] Scatter-gather idea, Yasushi SHOJI, 2017/04/05
- Re: [O] Scatter-gather idea, Nick Dokos, 2017/04/05
- Re: [O] Scatter-gather idea, Bob Newell, 2017/04/06
- Re: [O] Scatter-gather idea, Nick Dokos, 2017/04/06
- Re: [O] Scatter-gather idea,
John Kitchin <=
- Re: [O] Scatter-gather idea, Daniel Clemente, 2017/04/10