[comp.emacs] SUN selection in GNU emacs

kim@spock (Kim Letkeman) (04/06/90)

In article <3092@vexpert.uucp>, nejdl@vexpert.uucp (Wolfgang Nejdl) writes:
| We are using GNU Emacs 18.51 on a SUN-386i under SUN-OS 4.0.1.
| Everything works fine, except that we are not able to cut and paste
| between the emacstool window and other sunview windows. 
| 
| The functions supplied in sun-mouse.el (sun-select-region and
| sun-yank-selection) only work in the emacstool window but not outside
| (they do not change the selection buffer used in the other windows and
| vice versa).
| 

I too am interested in knowing if someone has solved this problem.
Emacs is, of course, a very general implementation so that it can run
on all platforms. As such, it takes over its environment and does not
"play nicely in sunview's sandbox."

What we have found here is that it is possible to move small amounts
of text from window to window when running emacs in a shell or command
tool, because the mouse stays sunview controlled. But anything beyond
perhaps 256 characters seems to get badly munged.

As well, coming into an emacs window causes the lines to move
progressivelt farther to the right. Wierd.

I have written one function which serves me for this particular
problem. It allows insertion into a buffer of any amount of text
selected on any part of the screen under sunview.

(defun sunview-selection-filter (process string)
  "handle selection process output"
  (insert string))

(defun insert-sunview-selection-at-point ()
  "insert highlighted selection at point"
  (interactive)
  (setq selection-process
	(start-process "selection" nil "get_selection"))
  (set-process-filter selection-process 'sunview-selection-filter))

A bit kludgy and not the fastest, but for the number of times I need
it, it does the job.

-- 
Kim Letkeman    uunet!mitel!spock!kim