comparison lisp/mouse.el @ 8135:1f57b34ade27

(mouse-drag-region): Bind this-command like last-command. (mouse-kill-ring-save): Bind this-command and last-command.
author Richard M. Stallman <rms@gnu.org>
date Mon, 04 Jul 1994 00:49:37 +0000
parents 20100d7e5b0f
children 0c7bcd40a21e
comparison
equal deleted inserted replaced
8134:7b7bb255393e 8135:1f57b34ade27
256 ;;; (eq (posn-window (event-end event)) start-window) 256 ;;; (eq (posn-window (event-end event)) start-window)
257 ;;; (numberp (posn-point (event-end event))) 257 ;;; (numberp (posn-point (event-end event)))
258 (let ((fun (key-binding (vector (car event))))) 258 (let ((fun (key-binding (vector (car event)))))
259 (if (not (= (overlay-start mouse-drag-overlay) 259 (if (not (= (overlay-start mouse-drag-overlay)
260 (overlay-end mouse-drag-overlay))) 260 (overlay-end mouse-drag-overlay)))
261 (let (last-command) 261 (let (last-command this-command)
262 (push-mark (overlay-start mouse-drag-overlay) t t) 262 (push-mark (overlay-start mouse-drag-overlay) t t)
263 (goto-char (overlay-end mouse-drag-overlay)) 263 (goto-char (overlay-end mouse-drag-overlay))
264 (copy-region-as-kill (point) (mark t))) 264 (copy-region-as-kill (point) (mark t)))
265 (goto-char (overlay-end mouse-drag-overlay)) 265 (goto-char (overlay-end mouse-drag-overlay))
266 (setq this-command 'mouse-set-point)))) 266 (setq this-command 'mouse-set-point))))
388 (defun mouse-kill-ring-save (click) 388 (defun mouse-kill-ring-save (click)
389 "Copy the region between point and the mouse click in the kill ring. 389 "Copy the region between point and the mouse click in the kill ring.
390 This does not delete the region; it acts like \\[kill-ring-save]." 390 This does not delete the region; it acts like \\[kill-ring-save]."
391 (interactive "e") 391 (interactive "e")
392 (mouse-set-mark-fast click) 392 (mouse-set-mark-fast click)
393 (kill-ring-save (point) (mark t)) 393 (let (this-command last-command)
394 (kill-ring-save (point) (mark t)))
394 (mouse-show-mark)) 395 (mouse-show-mark))
395 396
396 ;;; This function used to delete the text between point and the mouse 397 ;;; This function used to delete the text between point and the mouse
397 ;;; whenever it was equal to the front of the kill ring, but some 398 ;;; whenever it was equal to the front of the kill ring, but some
398 ;;; people found that confusing. 399 ;;; people found that confusing.