aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2007-12-25 20:02:45 +0000
committerRichard M. Stallman2007-12-25 20:02:45 +0000
commit98b2fff491674a78037fdf8a3239c286908d8627 (patch)
tree2c56fdc8d98278c16858fdaa5fd32929b25163a7
parent73fe9da0c11055f604cc389db78d2d5596bd340b (diff)
downloademacs-98b2fff491674a78037fdf8a3239c286908d8627.tar.gz
emacs-98b2fff491674a78037fdf8a3239c286908d8627.zip
(select-active-regions): New option.
(set-mark): Obey it.
-rw-r--r--lisp/simple.el9
1 files changed, 9 insertions, 0 deletions
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'."
3300 (setq mark-active nil) 3300 (setq mark-active nil)
3301 (run-hooks 'deactivate-mark-hook)))) 3301 (run-hooks 'deactivate-mark-hook))))
3302 3302
3303(defcustom select-active-regions nil
3304 "If non-nil, an active region automatically becomes the window selection."
3305 :type 'boolean
3306 :group 'killing
3307 :version "23.1")
3308
3303(defun set-mark (pos) 3309(defun set-mark (pos)
3304 "Set this buffer's mark to POS. Don't use this function! 3310 "Set this buffer's mark to POS. Don't use this function!
3305That is to say, don't use this function unless you want 3311That is to say, don't use this function unless you want
@@ -3321,6 +3327,9 @@ store it in a Lisp variable. Example:
3321 (progn 3327 (progn
3322 (setq mark-active t) 3328 (setq mark-active t)
3323 (run-hooks 'activate-mark-hook) 3329 (run-hooks 'activate-mark-hook)
3330 (and select-active-regions
3331 (x-set-selection
3332 nil (buffer-substring (region-beginning) (region-end))))
3324 (set-marker (mark-marker) pos (current-buffer))) 3333 (set-marker (mark-marker) pos (current-buffer)))
3325 ;; Normally we never clear mark-active except in Transient Mark mode. 3334 ;; Normally we never clear mark-active except in Transient Mark mode.
3326 ;; But when we actually clear out the mark value too, 3335 ;; But when we actually clear out the mark value too,