changeset 87386:9ec633b7a53d

(select-active-regions): New option. (set-mark): Obey it.
author Richard M. Stallman <rms@gnu.org>
date Tue, 25 Dec 2007 20:02:45 +0000
parents 4f4b8e4f7e4e
children e73e483c5735
files lisp/simple.el
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/simple.el	Tue Dec 25 19:55:59 2007 +0000
+++ b/lisp/simple.el	Tue Dec 25 20:02:45 2007 +0000
@@ -3300,6 +3300,12 @@
     (setq mark-active nil)
     (run-hooks 'deactivate-mark-hook))))
 
+(defcustom select-active-regions nil
+  "If non-nil, an active region automatically becomes the window selection."
+  :type 'boolean
+  :group 'killing
+  :version "23.1")
+
 (defun set-mark (pos)
   "Set this buffer's mark to POS.  Don't use this function!
 That is to say, don't use this function unless you want
@@ -3321,6 +3327,9 @@
       (progn
 	(setq mark-active t)
 	(run-hooks 'activate-mark-hook)
+	(and select-active-regions
+	     (x-set-selection
+	      nil (buffer-substring (region-beginning) (region-end))))
 	(set-marker (mark-marker) pos (current-buffer)))
     ;; Normally we never clear mark-active except in Transient Mark mode.
     ;; But when we actually clear out the mark value too,