🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.epoch.misc
Article #1160

Re: Additions to motion.el: Select words, lines, etc.

#1160
From: Shankar Unni
Date: Fri, 25 Sep 1992 19:28
39 lines
1844 bytes
John Cooper (jsc@saxon.Eng.Sun.COM) wrote:

> Also, when I do a paste, is it possible to arrange for the paste to
> occur at point, instead of at the position where I press button 2 ?

I have done a cheap hack for that::

    ;;;
    (defun paste-cut-buffer-before-point (arg)
      "Retrieve text from appropriate selection, or X cut-buffer if none,
    and paste it just before \(point\)"
      (let ( (buff (nth 1 arg)) )
	(when (and buff (bufferp buff))
    ;;    (save-excursion
	    (set-buffer buff)
	    (undo-boundary)
	    ;;;; (goto-char (min (car arg) (point-max)))
	    ; get text from selection PRIMARY
	    ; insert text once it's there.
	    (let
	      (
		(text
		  (epoch::convert-selection mouse::selection-atom
		    "STRING" "PROPERTY"))
	      )
	      ; Make sure string isn't ""
	      (if (and (stringp text) (> (length text) 0))
		(insert text)	; selection is owned and has a value
		(insert (get-cut-buffer))	; grab cut-buffer instead
	      )
	    )
    ;;    )
    )))

    (global-set-mouse mouse-middle mouse-down 'paste-cut-buffer-before-point)

--
Shankar Unni				E-Mail:	shankar@sgi.com
Silicon Graphics Inc.			Phone:	+1-415-390-2072
Technical Details
Message-ID: <19vp94INNmpv@fido.asd.sgi.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!darwin.sura.net!sgiblab!sgigate!odin!fido!shankar
References: <JSC.92Sep24200606@saxon.Eng.Sun.COM>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fc7ee,e9ba55957fcb5088
X-Google-Attributes: gidfc7ee,public
X-Google-ArrivalTime: 1992-09-25 06:09:20 PST
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!darwin.sura.net!sgiblab!sgigate!odin!fido!shankar
From: shankar@sgi.com (Shankar Unni)
Newsgroups: gnu.epoch.misc
Subject: Re: Additions to motion.el: Select words, lines, etc.
Date: 25 Sep 1992 19:28:36 GMT
Organization: Silicon Graphics, Inc.
Lines: 39
Distribution: gnu
Message-ID: <19vp94INNmpv@fido.asd.sgi.com>
References: <JSC.92Sep24200606@saxon.Eng.Sun.COM>
NNTP-Posting-Host: boris.wpd.sgi.com
X-Newsreader: Tin 1.1 PL5