emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/mouse.el [emacs-unicode-2]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/mouse.el [emacs-unicode-2]
Date: Mon, 28 Jun 2004 04:36:32 -0400

Index: emacs/lisp/mouse.el
diff -c emacs/lisp/mouse.el:1.241.8.1 emacs/lisp/mouse.el:1.241.8.2
*** emacs/lisp/mouse.el:1.241.8.1       Fri Apr 16 12:50:08 2004
--- emacs/lisp/mouse.el Mon Jun 28 07:28:43 2004
***************
*** 42,47 ****
--- 42,53 ----
    "*If non-nil, mouse yank commands yank at point instead of at click."
    :type 'boolean
    :group 'mouse)
+ 
+ (defcustom mouse-drag-copy-region t
+   "*If non-nil, mouse drag copies region to kill-ring."
+   :type 'boolean
+   :group 'mouse)
+ 
  
  ;; Provide a mode-specific menu on a mouse button.
  
***************
*** 612,622 ****
      ;; Don't set this-command to kill-region, so that a following
      ;; C-w will not double the text in the kill ring.
      ;; Ignore last-command so we don't append to a preceding kill.
!     (let (this-command last-command deactivate-mark)
!       (copy-region-as-kill (mark) (point)))
      (mouse-set-region-1)))
  
  (defun mouse-set-region-1 ()
    (setq mouse-last-region-beg (region-beginning))
    (setq mouse-last-region-end (region-end))
    (setq mouse-last-region-tick (buffer-modified-tick)))
--- 618,631 ----
      ;; Don't set this-command to kill-region, so that a following
      ;; C-w will not double the text in the kill ring.
      ;; Ignore last-command so we don't append to a preceding kill.
!     (when mouse-drag-copy-region
!       (let (this-command last-command deactivate-mark)
!       (copy-region-as-kill (mark) (point))))
      (mouse-set-region-1)))
  
  (defun mouse-set-region-1 ()
+   ;; Set transient-mark-mode for a little while.
+   (setq transient-mark-mode (or transient-mark-mode 'only))
    (setq mouse-last-region-beg (region-beginning))
    (setq mouse-last-region-end (region-end))
    (setq mouse-last-region-tick (buffer-modified-tick)))
***************
*** 827,834 ****
                  (push-mark region-commencement t t)
                  (goto-char region-termination)
                  ;; Don't let copy-region-as-kill set deactivate-mark.
!                 (let (deactivate-mark)
!                   (copy-region-as-kill (point) (mark t)))
                  (let ((buffer (current-buffer)))
                    (mouse-show-mark)
                    ;; mouse-show-mark can call read-event,
--- 836,844 ----
                  (push-mark region-commencement t t)
                  (goto-char region-termination)
                  ;; Don't let copy-region-as-kill set deactivate-mark.
!                 (when mouse-drag-copy-region
!                   (let (deactivate-mark)
!                     (copy-region-as-kill (point) (mark t))))
                  (let ((buffer (current-buffer)))
                    (mouse-show-mark)
                    ;; mouse-show-mark can call read-event,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]