Copying (yanking) only visible text in emacs outline-mode
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
Edit: Tom Faulhaber's solution, as per the comment below:
https://gist.github.com/tomfaulhaber/519635
Original answer:
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.
精彩评论