emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: how to test whether region is active during a mouse event?


From: Drew Adams
Subject: RE: how to test whether region is active during a mouse event?
Date: Sun, 2 Aug 2009 15:32:11 -0700

> > Also good to know, I guess. What was the bug (in practical, 
> > use-case terms) that this is intended to fix?
> 
> select-active-regions was winding up setting incorrect selections in 
> some mouse interactions like the ones you were doing.   It 
> "snapshots" the last active region's contents when the mark
> deactivates so that it can persist as-is after the mark is
> deactivated.  Without the reordering, it was getting the wrong
> string sometimes but not always (in a pattern that of course
> retrospectively makes sense, but at the time, man...)

OK, thanks for the explanation, David.


FWIW -

I never heard of `select-active-regions'. That option is not documented in the
Emacs manual or the Elisp manual. And the doc string does not, I'm afraid, help
me understand what it is for or what it does.

Doc string:
"If non-nil, an active region automatically becomes the window selection."

I have no idea what the "window-selection" is. And that term is not even used
anywhere else in the same file that defines it (simple.el). Is it
described/defined anywhere?

Also, user option `select-active-regions' is not used anywhere in the Lisp code,
except for a single occurrence in the definition of function `set-mark'. And
although the option modifies the behavior of `set-mark', it is not mentioned in
the doc (e.g. doc string) for `set-mark'.

To me, this lack of explanation/description is a doc bug, but if you like, take
it as a friendly suggestion:

This is a user option. If you really expect users to understand and use it, then
a little more guidance would help. As it is, (a) I haven't a clue, and (b) I
never would have heard of this if you hadn't referred to it, in passing, in the
context of a bug fix.

The only way to understand what this does is to grep the source code and
discover that it serves as a guard, to prevent (if nil) setting the X-Window
selection. At least that much should be said. If you say "X-Window selection",
at least a user will have something to look up, if it's not clear. "window
selection" is much less helpful.

HTH.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]