home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.emacs.help
- Path: sparky!uunet!spool.mu.edu!agate!usenet.ins.cwru.edu!news.ysu.edu!do-not-reply-to-path
- From: ah663@yfn.ysu.edu (Mike Sentipal)
- Subject: Re: WANTED: highlight-region code
- Message-ID: <1992Dec14.235228.17410@news.ysu.edu>
- Sender: news@news.ysu.edu (Usenet News Admin)
- Nntp-Posting-Host: yfn.ysu.edu
- Reply-To: ah663@yfn.ysu.edu (Mike Sentipal)
- Organization: St. Elizabeth Hospital, Youngstown, OH
- References: <RATINOX.92Dec12102156@splinter.coe.northeastern.edu>
- Date: Mon, 14 Dec 1992 23:52:28 GMT
- Lines: 32
-
-
- In a previous article, ratinox@splinter.coe.northeastern.edu (Richard Pieri) says:
-
- >I'm looking for some generic code to highlight a region. I've tried
-
- Here are some functions from ispell.el:
-
- (defun highlight-region (p1 p2)
- "Highlight the current region. You may have to rewrite this for your
- particular terminal."
- (interactive "r")
- (let ((s (buffer-substring p1 p2))
- (inverse-video t))
- (delete-region p1 p2)
- (sit-for 0)
- (insert s)
- (sit-for 0)))
-
- (defun unhighlight-region (p1 p2)
- "Unhighlight the current region. See highlight-region."
- (interactive "r")
- (let ((s (buffer-substring p1 p2))
- (inverse-video nil))
- (delete-region p1 p2)
- (sit-for 0)
- (insert s)
- (sit-for 0)))
-
- --
- =======================================
- Mike S. ah663@yfn.ysu.edu
- =======================================
-