7

So, I'm pretty much a noob with regards to Emacs and Org-Mode but I'm wondering if a particular feature exists...

A lot of old outliners (I'm talking MS-DOS era) had a feature called "Mark and Gather," where you were able to mark several items and move them all at once.

I'm wondering if this functionality exists anywhere in Org-Mode.

To be clear, I'm wondering if there's a way to mark several headings then run Org-Refile to move them all at once.

Everything I find about marking seems to refer either to selecting text or turning something into a Todo item.

2
  • Could you include a reference to somewhere "Mark and Gather" is defined / discussed? Your explanation is good and clear, but some historical context would be very interesting!
    – ebpa
    Jan 10, 2016 at 16:44
  • 1
    Here is a blog post that looks at Symantec GrandView, one of the old DOS outliners and its functionality. I personally became really interested in the feature set a while back when I became enamored with an old app called MaxThink which eventually led me to Org-Mode.
    – Bob
    Jan 10, 2016 at 18:23

3 Answers 3

6

You can select items by hitting m on each one, or using a regexp by hitting %.

Once you've selected the agenda items, entering B will give you a menu of bulk actions, including r to refile. See the manual under "Commands in the agenda buffer" for more info.

3
  • 2
    Thanks, but I was wondering if there was any way to do this outside of the Agenda? Or if not (again, apologize, but I'm very much new here) is there any way to convert my entire document into an agenda buffer?
    – Bob
    Jan 10, 2016 at 2:54
  • To get all the top-level headlines try a match search restricted to the document (C-c a m <) for LEVEL=1.
    – erikstokes
    Jan 10, 2016 at 15:06
  • I have created a custom agenda view that lists all the headings that I would like to refile to a location. Is it possible to group these actions into a single function so that I could achieve these with a hot-key: 1. activate agenda dispatcher, 2. show my custom agenda view, 3. select all items, 4. bulk action, 5. refile. Any hint how I could do this?
    – Jason
    Nov 28, 2020 at 13:06
6

It is not quite as nice as how it works in an org-agenda buffer as @Brian Z describes, but within an actual .org file, all the items in a selected region will be refiled when you call org-refile. So you could set the mark, highlight all the headlines you want to act on, and call org-refile through whatever key combination you have it bound to.

In addition, if you want to use the agenda buffer for processing headlines, you can run org-agenda, and then select the view that shows all TODOs (t) or create a custom view tailored to your needs (like one that includes all the headlines in your document) and act on tasks from there as described by @Brian Z.

2

I too have hoped for this feature outside of org-agenda and the closest I have found convenience-wise is to rely on the default completion behavior.

After refiling an item the refile target is the default target until something is refiled to a different target. I, for example, have org-refile bound to C-c C-w, so after refiling the first heading would press C-c C-w <enter> at each heading that should also be refiled to the same location.

You are probably already aware of this "method", but it might be useful for someone to know even though it is less efficient than marking within org-agenda.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.