[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Hiding text in emacs buffer that matches regexp
From: |
Kelly Jones |
Subject: |
Hiding text in emacs buffer that matches regexp |
Date: |
Sun, 17 Dec 2006 13:59:18 -0700 |
I'm writing some Perl functions, and the POD doc uses up a lot of
screen real estate:
=item make_ref(URL,TEXT)
Return string to make text a hyperlink to URL
=cut
sub make_ref {return "<a href=\"$_[0]\">$_[1]</a>"}
(1 line of code to 5 lines of docs).
How can I tell emacs: hide all text matching the Perl regex
"/^=item.*?=cut$/is" and replace it with "<<pod>>" or something similar.
I still want the text to "be" in the buffer and want it saved to
disk-- I just don't want it displayed to me.
Ideally, this would be a toggle that I could turn off/on so I could
see the docs when I wanted to edit them.
I'd be interested in the answer in general, but if there's a POD mode
for emacs that would do this, that'd be great too.
--
We're just a Bunch Of Regular Guys, a collective group that's trying
to understand and assimilate technology. We feel that resistance to
new ideas and technology is unwise and ultimately futile.
- Hiding text in emacs buffer that matches regexp,
Kelly Jones <=