Function: mouse-kill-preserving-secondary

mouse-kill-preserving-secondary is an interactive and byte-compiled function defined in mouse-copy.el.gz.

Signature

(mouse-kill-preserving-secondary)

Documentation

Kill the text in the secondary selection, but leave the selection set.

This command is like M-x mouse-kill-secondary (mouse-kill-secondary) (that is, the secondary selection is deleted and placed in the kill ring), except that it also leaves the secondary buffer active on exit.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/mouse-copy.el.gz
(defun mouse-kill-preserving-secondary ()
  "Kill the text in the secondary selection, but leave the selection set.

This command is like \\[mouse-kill-secondary] (that is, the secondary
selection is deleted and placed in the kill ring), except that it also
leaves the secondary buffer active on exit."
  ;; This command was derived from mouse-kill-secondary in emacs-19.28
  ;; by johnh@ficus.cs.ucla.edu.
  (interactive)
  (let* ((keys (this-command-keys))
	 (click (elt keys (1- (length keys)))))
    (or (eq (overlay-buffer mouse-secondary-overlay)
	    (if (listp click)
		(window-buffer (posn-window (event-start click)))
	      (current-buffer)))
	(error "Select or click on the buffer where the secondary selection is")))
  (with-current-buffer (overlay-buffer mouse-secondary-overlay)
    (kill-region (overlay-start mouse-secondary-overlay)
		 (overlay-end mouse-secondary-overlay)))
  ;; (delete-overlay mouse-secondary-overlay)
  ;; (gui-set-selection 'SECONDARY nil)
  ;; (setq mouse-secondary-overlay nil)
  )