tags:

views:

41

answers:

1

Sometimes I'd like to copy only the visible text from an outline-mode buffer in emacs, ignoring hidden leaves, etc.

I don't see any way to do this. When I use M-w and then paste somewhere else, I get all the text, including the hidden parts.

Does anyone know how to do this? The manual and google aren't helping.

Thanks,

Tom

+1  A: 

FWIW, org-mode has org-export-visible, and is derived from outline-mode, so maybe that code could be adapted if no other solution exists?

There's also M-x outline-headers-as-kill which works on the region in outline-minor-mode. That's also not what you wanted, but perhaps provides another approach for implementation.

phils
Per your suggestion, I simplified org-export-visible to create outline-yank-visible. The code is here http://gist.github.com/519635 if anyone needs it.
Tom Faulhaber
Nice one. That function copies rather than yanks, though... maybe `outline-copy-visible` would be a better name?
phils
Good point, I don't know quite what I was thinking with the name. I changed it as you suggest in the gist.
Tom Faulhaber