summaryrefslogtreecommitdiff
path: root/lisp/select.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2009-07-15 01:25:32 +0000
committerChong Yidong <cyd@stupidchicken.com>2009-07-15 01:25:32 +0000
commitf9be2e356915fd56496dc2583e4856b5ccf95664 (patch)
tree0c618bbfeca73e3583da5a02204238c3e9f851a7 /lisp/select.el
parentcbd61418b367a9329ed51b5748019a75a5c7e9cf (diff)
downloademacs-f9be2e356915fd56496dc2583e4856b5ccf95664.tar.gz
* simple.el (deactivate-mark): Optional argument FORCE.
(set-mark): Use deactivate-mark. * info.el (Info-search): No need to check transient-mark-mode before calling deactivate-mark. * select.el (x-set-selection): Doc fix. (x-valid-simple-selection-p): Allow buffer values. (xselect--selection-bounds): Handle buffer values. Suggested by David De La Harpe Golden. * mouse.el (mouse-set-region, mouse-drag-track): Call copy-region-as-kill before setting the mark, to let select-active-regions work. * simple.el (deactivate-mark): If select-active-regions is non-nil, copy the selection data into a string. (activate-mark): If select-active-regions is non-nil, set the selection to the current buffer. (set-mark): Update selection if select-active-regions is non-nil. * select.el (x-valid-simple-selection-p): Allow buffer values.
Diffstat (limited to 'lisp/select.el')
-rw-r--r--lisp/select.el28
1 files changed, 17 insertions, 11 deletions
diff --git a/lisp/select.el b/lisp/select.el
index cc15bed7580..a65f2908b24 100644
--- a/lisp/select.el
+++ b/lisp/select.el
@@ -122,15 +122,16 @@ equivalent to `PRIMARY'. (It can also be a string, which stands
for the symbol with that name, but this usage is obsolete.)
DATA is a selection value. It should be one of the following:
- - a vector of non-vector selection values
- - a string
- - an integer
- - a cons cell of two markers pointing to the same buffer
- - an overlay
-In the latter two cases, the selection is considered to be the
-text between the markers at whatever time the selection is
-examined. Thus, editing done in the buffer after you specify the
-selection can alter the effective value of the selection.
+ - A vector of non-vector selection values.
+ - A string.
+ - An integer.
+ - A cons cell of two markers pointing to the same buffer
+ (the data consists of the text between the markers).
+ - An overlay (the data consists of the text within the overlay).
+ - A buffer (the data consists of the text in the region).
+For the last three cases, the actual selection data is computed
+only when the selection is requested. Thus, it includes any
+changes made to the buffer after `x-set-selection' is called.
The return value is DATA.
@@ -158,7 +159,8 @@ prefix argument, it uses the text of the region as the selection value ."
data)
(defun x-valid-simple-selection-p (data)
- (or (and (consp data)
+ (or (bufferp data)
+ (and (consp data)
(markerp (car data))
(markerp (cdr data))
(marker-buffer (car data))
@@ -210,7 +212,11 @@ Cut buffers are considered obsolete; you should use selections instead."
"Return bounds of X selection value VALUE.
The return value is a list (BEG END BUF) if VALUE is a cons of
two markers or an overlay. Otherwise, it is nil."
- (cond ((and (consp value)
+ (cond ((bufferp value)
+ (with-current-buffer value
+ (when (mark t)
+ (list (mark t) (point) value))))
+ ((and (consp value)
(markerp (car value))
(markerp (cdr value)))
(when (and (marker-buffer (car value))