home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.emacs.sources
- Path: sparky!uunet!stanford.edu!CSD-NewsHost.Stanford.EDU!times!wmesard
- From: wmesard@Pescadero.Stanford.EDU (Wayne Mesard)
- Subject: wsm-xm-clip: another x-sb-mouse customization
- Message-ID: <WMESARD.92Jul28174430@Pescadero.Stanford.EDU>
- Sender: news@CSD-NewsHost.Stanford.EDU
- Reply-To: wmesard@cs.stanford.edu
- Organization: /pescadero/u3/wmesard/.organization
- Date: 28 Jul 92 17:44:30
- Lines: 91
-
- Here's a small customization that modifies the way a couple of cutting
- and pasting functions work in x-sb-mouse so that the behavior is more
- consistent with cutting and pasting in Xterm windows. (X-sb-mouse's
- goal was to be backwards compatible with alt-mouse, but my fingers are
- too stupid to remember two sets of mouse gestures.)
-
- See the DESCRIPTION section for details.
-
- Wayne();
- WMesard@cs.stanford.edu
-
- P.S. X-sb-mouse is available from the archive (archive.cis.ohio-state.edu)
- in /pub/gnu/emacs/elisp-archive/misc/x-sb-mouse.tar.Z.
-
- ----snoop---croockle---poop----
- ;;; wsm-xm-clip.el: WSM's cutting/copying customizations for x-sb-mouse
- ;;; Copyright (C) 1992 Wayne Mesard
- ;;;
- ;;; This program is free software; you can redistribute it and/or modify
- ;;; it under the terms of the GNU General Public License as published by
- ;;; the Free Software Foundation; either version 1, or (at your option)
- ;;; any later version.
- ;;;
- ;;; This program is distributed in the hope that it will be useful,
- ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
- ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- ;;; GNU General Public License for more details.
- ;;;
- ;;; The GNU General Public License is available by anonymouse ftp from
- ;;; prep.ai.mit.edu in pub/gnu/COPYING. Alternately, you can write to
- ;;; the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
- ;;; USA.
- ;;--------------------------------------------------------------------
-
- ;;; DESCRIPTION
- ;; Make cutting and pasting behave more like it does in xterms (my poor
- ;; mouse-hand can only remember one set of bindings):
- ;;
- ;; * Right-click copies everything between point and the mouse location.
- ;;
- ;; * Middle-click inserts the cut-buffer _at_point_ in _active_buffer_
- ;; (Instead of at mouse-point (like x-sb-paste-text) and instead of
- ;; at point in the buffer under the mouse (like x-mouse-paste-there).)
- ;; Also, moves the point to the end of the inserted text .
- ;;
- ;; The vanilla X-sb-mouse functions are still available (since
- ;; they're bound to multiple gestures by default):
- ;;
- ;; * x-mouse-paste-text is on Control-middle-click.
- ;; * x-mouse-paste-there is on Shift-right-click
- ;;
- ;; Wayne Mesard: wmesard@cs.stanford.edu
-
-
- ;;; HISTORY
- ;; 1.0 wmesard - Jul 16, 1992: Created
-
- ;;;
- ;;; DEPENDENCIES
- ;;;
-
- ;; x-sb-mouse version 1.6
- (require 'x-sb-mouse)
-
- ;;;
- ;;; BINDINGS
- ;;;
-
- (x-mouse-define-key "x-mouse-3-window-click" t
- 'default 'wsm-x-mouse-copy-region-to-x)
- (x-mouse-define-key "x-mouse-2-window-click" t
- 'default 'wsm-x-mouse-paste-there)
-
- ;;;
- ;;; PUBLIC FUNCTIONS
- ;;;
-
- (defun wsm-x-mouse-copy-region-to-x ()
- "Copies the text between point and mouse point to the X cut-buffer."
- (set-buffer (window-buffer x-mouse-win-u))
- (x-store-cut-buffer (buffer-substring x-mouse-point-u (point)))
- )
-
- (defun wsm-x-mouse-paste-there ()
- "Like x-mouse-paste-there, except that it pastes the X cut buffer at the
- point of the _active_ buffer, not the buffer being pointed to. Also, it
- moves the point to the end of the inserted text."
- (insert (x-get-cut-buffer)))
-
-
-
-