unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Hiding text in emacs buffer that matches regexp
@ 2006-12-17 20:59 Kelly Jones
  2006-12-18  4:04 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Kelly Jones @ 2006-12-17 20:59 UTC (permalink / raw)


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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Hiding text in emacs buffer that matches regexp
  2006-12-17 20:59 Hiding text in emacs buffer that matches regexp Kelly Jones
@ 2006-12-18  4:04 ` Eli Zaretskii
  0 siblings, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2006-12-18  4:04 UTC (permalink / raw)


> Date: Sun, 17 Dec 2006 13:59:18 -0700
> From: "Kelly Jones" <kelly.terry.jones@gmail.com>
> 
> 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.

Read the node "Invisible Text" in the ELisp manual.  It describes how
to make this happen.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Hiding text in emacs buffer that matches regexp
       [not found] <mailman.2024.1166389165.2155.help-gnu-emacs@gnu.org>
@ 2006-12-18 14:39 ` Mathias Dahl
  0 siblings, 0 replies; 3+ messages in thread
From: Mathias Dahl @ 2006-12-18 14:39 UTC (permalink / raw)


"Kelly Jones" <kelly.terry.jones@gmail.com> writes:

> How can I tell emacs: hide all text matching the Perl regex
> "/^=item.*?=cut$/is" and replace it with "<<pod>>" or something
> similar.

Try this:

http://www.emacswiki.org/cgi-bin/wiki/HideLines

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-12-18 14:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-17 20:59 Hiding text in emacs buffer that matches regexp Kelly Jones
2006-12-18  4:04 ` Eli Zaretskii
     [not found] <mailman.2024.1166389165.2155.help-gnu-emacs@gnu.org>
2006-12-18 14:39 ` Mathias Dahl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).