🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Jan Rekers Tue, 09 Jun 1992 13:17
insertion point after a paste
#1336
Author: Jan Rekers
Date: Tue, 09 Jun 1992 13:17
19 lines
1157 bytes
Would anybody know how I can get Epoch to move its insertion point
(the cursor) after a mouse paste to the point just after the inserted text?
That would in most cases allow me to type on after an insertion.

Say, I have the following text in my buffer:
	aap noot mies
Now, if I paste the contents of the mouse buffer, say ``jan '', by clicking
the middle mouse button just before ``noot'', Epoch leaves me in the 
following situation:
	aap jan noot mies
	    ^
while I would like it to be:
	aap jan noot mies
	        ^

Thanks in advance,

Jan Rekers (Jan.Rekers@cwi.nl) Centrum voor Wiskunde en Informatica (CWI)
                        P.O. Box 4079, 1009 AB Amsterdam, The Netherlands
Re: insertion point after a paste
#1338
Author: Andreas Schwab
Date: Tue, 09 Jun 1992 14:43
48 lines
2374 bytes
In article <6261@charon.cwi.nl>, rekers@cwi.nl (Jan Rekers) writes:
|> Would anybody know how I can get Epoch to move its insertion point
|> (the cursor) after a mouse paste to the point just after the inserted text?
|> That would in most cases allow me to type on after an insertion.
|> 
|> Say, I have the following text in my buffer:
|> 	aap noot mies
|> Now, if I paste the contents of the mouse buffer, say ``jan '', by clicking
|> the middle mouse button just before ``noot'', Epoch leaves me in the 
|> following situation:
|> 	aap jan noot mies
|> 	    ^
|> while I would like it to be:
|> 	aap jan noot mies
|> 	        ^
|> 
|> Thanks in advance,
|> 
|> Jan Rekers (Jan.Rekers@cwi.nl) Centrum voor Wiskunde en Informatica (CWI)
|>                         P.O. Box 4079, 1009 AB Amsterdam, The Netherlands

Replace `mouse::paste-cut-buffer' (see epoch-lisp/mouse.el) with the
following function:

(defun paste-cut-buffer (arg)
  "Retrieve text from appropriate selection, or X cut-buffer if none"
  (let ((buff (nth 1 arg)))
    (when (and buff (bufferp buff))
      (mouse::set-point arg)
      (undo-boundary)
      (goto-char (car arg))
      ;; 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))
	    ;; selection is owned and has a value
	    (insert text)
	  ;; grab cut-buffer instead
	  (insert (get-cut-buffer)))))))

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

--
Andreas Schwab
schwab@ls5.informatik.uni-dortmund.de
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads