comparison lisp/mouse.el @ 3119:0d4886af9262

(mouse-set-mark): Activate the mark. Don't bounce the cursor if Transient Mark mode. (mouse-save-then-kill): Pass explicit args to kill-ring-save. (mouse-kill-ring-save): Likewise.
author Richard M. Stallman <rms@gnu.org>
date Wed, 26 May 1993 18:09:52 +0000
parents 02c75b605550
children fb322590dda0
comparison
equal deleted inserted replaced
3118:e7dd24a618fb 3119:0d4886af9262
165 This must be bound to a mouse click." 165 This must be bound to a mouse click."
166 (interactive "e") 166 (interactive "e")
167 (let ((point-save (point))) 167 (let ((point-save (point)))
168 (unwind-protect 168 (unwind-protect
169 (progn (mouse-set-point click) 169 (progn (mouse-set-point click)
170 (push-mark nil t) 170 (push-mark nil t t)
171 (sit-for 1)) 171 (or transient-mark-mode
172 (sit-for 1)))
172 (goto-char point-save)))) 173 (goto-char point-save))))
173 174
174 (defun mouse-kill (click) 175 (defun mouse-kill (click)
175 "Kill the region between point and the mouse click. 176 "Kill the region between point and the mouse click.
176 The text is saved in the kill ring, as with \\[kill-region]." 177 The text is saved in the kill ring, as with \\[kill-region]."
190 (defun mouse-kill-ring-save (click) 191 (defun mouse-kill-ring-save (click)
191 "Copy the region between point and the mouse click in the kill ring. 192 "Copy the region between point and the mouse click in the kill ring.
192 This does not delete the region; it acts like \\[kill-ring-save]." 193 This does not delete the region; it acts like \\[kill-ring-save]."
193 (interactive "e") 194 (interactive "e")
194 (mouse-set-mark click) 195 (mouse-set-mark click)
195 (call-interactively 'kill-ring-save)) 196 (kill-ring-save (point) (mark t)))
196 197
197 ;;; This function used to delete the text between point and the mouse 198 ;;; This function used to delete the text between point and the mouse
198 ;;; whenever it was equal to the front of the kill ring, but some 199 ;;; whenever it was equal to the front of the kill ring, but some
199 ;;; people found that confusing. 200 ;;; people found that confusing.
200 201
223 (if (not (eq buffer-undo-list t)) 224 (if (not (eq buffer-undo-list t))
224 (setq buffer-undo-list 225 (setq buffer-undo-list
225 (cons (cons (car kill-ring) (point)) buffer-undo-list)))) 226 (cons (cons (car kill-ring) (point)) buffer-undo-list))))
226 ;; Otherwise, save this region. 227 ;; Otherwise, save this region.
227 (mouse-set-mark click) 228 (mouse-set-mark click)
228 (call-interactively 'kill-ring-save) 229 (kill-ring-save (point) (mark t))
229 (setq mouse-save-then-kill-posn 230 (setq mouse-save-then-kill-posn
230 (list (car kill-ring) (point) click-posn))))) 231 (list (car kill-ring) (point) click-posn)))))
231 232
232 (defun mouse-buffer-menu (event) 233 (defun mouse-buffer-menu (event)
233 "Pop up a menu of buffers for selection with the mouse. 234 "Pop up a menu of buffers for selection with the mouse.