home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!decwrl!pacbell.com!hoptoad!amdcad!amdahl!JUTS!climb!tlp00
- From: tlp00@climb.ras.amdahl.com (Tibor Polgar)
- Newsgroups: alt.lucid-emacs.help
- Subject: extra mode-motion+ function
- Message-ID: <01AD02zI2b0x01@JUTS.ccc.amdahl.com>
- Date: 13 Nov 92 04:35:59 GMT
- Sender: netnews@ccc.amdahl.com
- Reply-To: tlp00@climb.ras.amdahl.com
- Organization: Sun Microsystems
- Lines: 43
-
- A while back Guido Bosch <bosch@loria.fr> posted a great addition to mode-motion
- called mode-motion+. Among the many enhancements to the standard were some mouseable
- functions to copy and delete/copy highlighed area. Well what i felt was
- missing was a simple "delete" highlighted region... so here it is. It is just a
- simple snip of one of his existing routines. Remember it won't run without his package.
-
- -------------------------------------------------------------------------------------
- (defun x-set-point-cut-highlighted-text (event)
- "Deletes highlighted region to point."
- (interactive "e")
- (let* ((point (event-point event))
- (window (event-window event))
- (buffer (and window (window-buffer window)))
- (extent (and point buffer
- (extent-at point buffer
- ;; 'highlight
- )))
- (text (and extent
- (save-window-excursion
- (set-buffer buffer)
- (prog1
- (buffer-substring
- (extent-start-position extent)
- (extent-end-position extent))
- (kill-region
- (extent-start-position extent)
- (extent-end-position extent)))))))
- ))
-
-
- (global-set-key '(control meta button2) 'x-set-point-cut-highlighted-text)
-
-
- -------------------------------------------------------------------------------
- | Tibor L. Polgar | (408) 746-8649 | tlp00@climb.ras.amdahl.com
- | Amdahl Corporation
- | 1250 East Arques Avenue (M/S 281)
- | P.O. Box 3470
- | Sunnyvale, CA 94088-3470
- |
- | The opinions expressed above are mine, solely, and do not in any way
- | shape or form reflect the opinions or policies of Amdahl Corp.
- -------------------------------------------------------------------------------
-