perm@MIZAR.DOCS.UU.SE (Per Mildner) (11/16/89)
I have the following loaded when I run under X windows. It makes the top of the kill ring available for yanking (with Mouse Middle) into any X window on the display, faster than most for transfering small files between machines. (defvar *cut-to-x* t "*If non-Nil cutting will go to X cut buffer too.") (defun copy-region-as-kill (beg end) "Save the region as if killed, but don't kill it. *cut-to-x* if non-Nil will move the region to the X cut buffer too." (interactive "r") (if (eq last-command 'kill-region) (kill-append (buffer-substring beg end) (< end beg)) (setq kill-ring (cons (buffer-substring beg end) kill-ring)) (if (> (length kill-ring) kill-ring-max) (setcdr (nthcdr (1- kill-ring-max) kill-ring) nil))) (if (and *cut-to-x* (eq window-system 'x)) (x-store-cut-buffer (car kill-ring))) (setq this-command 'kill-region) (setq kill-ring-yank-pointer kill-ring)) ) )