"Kirill M. Katsnelson" <kkm(a)kis.ru> writes:
Some time ago, Hrvoje Niksic wrote...
|+
| "Kirill M. Katsnelson" <kkm(a)kis.ru> writes:
|
| > I think that selection-owner-p must return the same as
| > (region-active-p) under Windows,
|
| This sounds wrong. When `zmacs-regions' is nil, (region-active-p)
| always returns nil, and yet the selections should still work. It is
| arranged that way under X, and we should preserve that design.
Thanks for pointing on that fact. What do you suggest?
To preserve that design. :-) Seriously, what it means is that the
selections are fully operational even without zmacs-regions. The
right way to achieve this is to comb through `mouse.el' and replace
x-specific selection code with the generic selection code, as coded by
Andy. Examples:
(defun default-mouse-track-has-selection-p (buffer)
(and (or (not (eq 'x (console-type)))
(x-selection-owner-p))
and:
(defun default-mouse-track-maybe-own-selection (pair type)
(let ((start (car pair))
(end (cdr pair)))
[...]
((eq 'x (console-type))
(if (= start end)
(x-disown-selection type)
[...]
(x-own-selection (buffer-substring (point-min) (point-max)))
(kill-buffer (current-buffer))))
(x-own-selection (cons (set-marker (make-marker) start)
(set-marker (make-marker) end))
type)))))
and:
(defun default-mouse-track-deal-with-down-event (click-count)
[...]
((eq 'x (console-type))
(x-disown-selection)))))
etc. Functions like `x-store-cutbuffer' are also used. Basically,
all the places in mouse.el where (eq (device-type) 'x) is used, or
where x-* functions are used, should be fixed.
This is why writing a good `select.el' is not as easy as it may seem.
However, it is more than worth it.
By the way, I have this im my .emacs:
(set-face-background 'zmacs-region "gray80")
When I click and drag with the mouse, the region being selected is
light gray. Although, after I release the button, it turns darker.
What's that?
You probably see the discrepancy between primary-selection face and
zmacs-region face.
The best way to learn about this is to start XEmacs on Solaris or
Linux, and experiment with selections with and without zmacs-regions.
--
Hrvoje Niksic <hniksic(a)srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
Ooh, Granny, what a BIG belly-button you have!