comparison 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
comparison
equal deleted inserted replaced
109397:4e6b8160da4b 109398:c9970d4bfd62
3664 a mistake; see the documentation of `set-mark'." 3664 a mistake; see the documentation of `set-mark'."
3665 (if (or force (not transient-mark-mode) mark-active mark-even-if-inactive) 3665 (if (or force (not transient-mark-mode) mark-active mark-even-if-inactive)
3666 (marker-position (mark-marker)) 3666 (marker-position (mark-marker))
3667 (signal 'mark-inactive nil))) 3667 (signal 'mark-inactive nil)))
3668 3668
3669 (defcustom select-active-regions nil 3669 (defcustom select-active-regions t
3670 "If non-nil, an active region automatically becomes the window selection." 3670 "If non-nil, an active region automatically becomes the window selection."
3671 :type 'boolean 3671 :type 'boolean
3672 :group 'killing 3672 :group 'killing
3673 :version "23.1") 3673 :version "23.1")
3674 3674
3685 ;; Copy the latest region into the primary selection, if desired. 3685 ;; Copy the latest region into the primary selection, if desired.
3686 (and select-active-regions 3686 (and select-active-regions
3687 mark-active 3687 mark-active
3688 (display-selections-p) 3688 (display-selections-p)
3689 (x-selection-owner-p 'PRIMARY) 3689 (x-selection-owner-p 'PRIMARY)
3690 (not (eq (region-beginning) (region-end)))
3690 (x-set-selection 'PRIMARY (buffer-substring-no-properties 3691 (x-set-selection 'PRIMARY (buffer-substring-no-properties
3691 (region-beginning) (region-end)))) 3692 (region-beginning) (region-end))))
3692 (if (and (null force) 3693 (if (and (null force)
3693 (or (eq transient-mark-mode 'lambda) 3694 (or (eq transient-mark-mode 'lambda)
3694 (and (eq (car-safe transient-mark-mode) 'only) 3695 (and (eq (car-safe transient-mark-mode) 'only)
3817 (let ((mark (marker-position (mark-marker)))) 3818 (let ((mark (marker-position (mark-marker))))
3818 (if (or arg (null mark) (/= mark (point))) 3819 (if (or arg (null mark) (/= mark (point)))
3819 (push-mark nil nomsg t) 3820 (push-mark nil nomsg t)
3820 (setq mark-active t) 3821 (setq mark-active t)
3821 (run-hooks 'activate-mark-hook) 3822 (run-hooks 'activate-mark-hook)
3823 (and select-active-regions (display-selections-p)
3824 (x-set-selection 'PRIMARY (current-buffer)))
3822 (unless nomsg 3825 (unless nomsg
3823 (message "Mark activated"))))) 3826 (message "Mark activated")))))
3824 3827
3825 (defcustom set-mark-command-repeat-pop nil 3828 (defcustom set-mark-command-repeat-pop nil
3826 "Non-nil means repeating \\[set-mark-command] after popping mark pops it again. 3829 "Non-nil means repeating \\[set-mark-command] after popping mark pops it again.