Mercurial > emacs
diff lisp/simple.el @ 109398:c9970d4bfd62
Change clipboard/primary selection to X application standards.
* lisp/menu-bar.el (menu-bar-enable-clipboard): Don't overwrite
Cut/Copy/Paste menu bar items.
* lisp/mouse.el: Bind mouse-2 to mouse-yank-primary.
(mouse-drag-copy-region): Default to nil.
* lisp/simple.el (select-active-regions): Default to t.
(push-mark-command): Don't overwrite primary with empty string.
* lisp/term/x-win.el (x-select-enable-clipboard): Default to t.
(x-initialize-window-system): Don't overwrite Paste menu item.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Wed, 14 Jul 2010 14:03:39 -0400 |
parents | 863ed9bd7c0e |
children | 051595eb9b58 |
line wrap: on
line diff
--- a/lisp/simple.el Wed Jul 14 12:41:40 2010 -0400 +++ b/lisp/simple.el Wed Jul 14 14:03:39 2010 -0400 @@ -3666,7 +3666,7 @@ (marker-position (mark-marker)) (signal 'mark-inactive nil))) -(defcustom select-active-regions nil +(defcustom select-active-regions t "If non-nil, an active region automatically becomes the window selection." :type 'boolean :group 'killing @@ -3687,6 +3687,7 @@ mark-active (display-selections-p) (x-selection-owner-p 'PRIMARY) + (not (eq (region-beginning) (region-end))) (x-set-selection 'PRIMARY (buffer-substring-no-properties (region-beginning) (region-end)))) (if (and (null force) @@ -3819,6 +3820,8 @@ (push-mark nil nomsg t) (setq mark-active t) (run-hooks 'activate-mark-hook) + (and select-active-regions (display-selections-p) + (x-set-selection 'PRIMARY (current-buffer))) (unless nomsg (message "Mark activated")))))