From 98b2fff491674a78037fdf8a3239c286908d8627 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 25 Dec 2007 20:02:45 +0000 Subject: [PATCH] (select-active-regions): New option. (set-mark): Obey it. --- lisp/simple.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lisp/simple.el b/lisp/simple.el index 2750fc85777..f4a5b51a68c 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3300,6 +3300,12 @@ Also runs the hook `deactivate-mark-hook'." (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 @@ store it in a Lisp variable. Example: (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, -- 2.39.2