/[emacs]/emacs/lisp/mouse.el
ViewVC logotype

Diff of /emacs/lisp/mouse.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.241.8.1 by handa, Fri Apr 16 12:50:08 2004 UTC revision 1.241.8.2 by miles, Mon Jun 28 07:28:43 2004 UTC
# Line 42  Line 42 
42    "*If non-nil, mouse yank commands yank at point instead of at click."    "*If non-nil, mouse yank commands yank at point instead of at click."
43    :type 'boolean    :type 'boolean
44    :group 'mouse)    :group 'mouse)
45    
46    (defcustom mouse-drag-copy-region t
47      "*If non-nil, mouse drag copies region to kill-ring."
48      :type 'boolean
49      :group 'mouse)
50    
51    
52  ;; Provide a mode-specific menu on a mouse button.  ;; Provide a mode-specific menu on a mouse button.
53    
# Line 612  This should be bound to a mouse drag eve Line 618  This should be bound to a mouse drag eve
618      ;; Don't set this-command to kill-region, so that a following      ;; Don't set this-command to kill-region, so that a following
619      ;; C-w will not double the text in the kill ring.      ;; C-w will not double the text in the kill ring.
620      ;; Ignore last-command so we don't append to a preceding kill.      ;; Ignore last-command so we don't append to a preceding kill.
621      (let (this-command last-command deactivate-mark)      (when mouse-drag-copy-region
622        (copy-region-as-kill (mark) (point)))        (let (this-command last-command deactivate-mark)
623            (copy-region-as-kill (mark) (point))))
624      (mouse-set-region-1)))      (mouse-set-region-1)))
625    
626  (defun mouse-set-region-1 ()  (defun mouse-set-region-1 ()
627      ;; Set transient-mark-mode for a little while.
628      (setq transient-mark-mode (or transient-mark-mode 'only))
629    (setq mouse-last-region-beg (region-beginning))    (setq mouse-last-region-beg (region-beginning))
630    (setq mouse-last-region-end (region-end))    (setq mouse-last-region-end (region-end))
631    (setq mouse-last-region-tick (buffer-modified-tick)))    (setq mouse-last-region-tick (buffer-modified-tick)))
# Line 827  If the click is in the echo area, displa Line 836  If the click is in the echo area, displa
836                    (push-mark region-commencement t t)                    (push-mark region-commencement t t)
837                    (goto-char region-termination)                    (goto-char region-termination)
838                    ;; Don't let copy-region-as-kill set deactivate-mark.                    ;; Don't let copy-region-as-kill set deactivate-mark.
839                    (let (deactivate-mark)                    (when mouse-drag-copy-region
840                      (copy-region-as-kill (point) (mark t)))                      (let (deactivate-mark)
841                          (copy-region-as-kill (point) (mark t))))
842                    (let ((buffer (current-buffer)))                    (let ((buffer (current-buffer)))
843                      (mouse-show-mark)                      (mouse-show-mark)
844                      ;; mouse-show-mark can call read-event,                      ;; mouse-show-mark can call read-event,

Legend:
Removed from v.1.241.8.1  
changed lines
  Added in v.1.241.8.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26