>>>> "jpw" == John Paul Wallington
<jpw(a)shootybangbang.com> writes:
jpw> `mouse-position' is only broken insofar as it faithfully
jpw> obeys its documentation...
This figures.
jpw> GNU Emacs' `mouse-position' returns positional values based
jpw> on standard character cells, even if the cursor isn't over a
jpw> character.
Is this broken according to their doc, or do they have a different
specification for the function? Either way, someone should get in
touch with the GNU Emacs project to adjust this. I have my
preferences, see below.
jpw> I guess `mouse-position' could do something similar, or
jpw> preferably better. I don't know whether any XEmacs specific
jpw> code relies upon `mouse-position' returning (nil nil) when
jpw> not over a character though.
The code you wrote is broken for proportional fonts, and for many
historical character cell fonts. Consider any buffer containing
native widgets. (What _should_ `mouse-position' do in that case, I
wonder?) However, rather than make a new function or break
`mouse-position', I would add a new (keyword) argument :force-estimate,
which would estimate based on distance from current line-ending to
mouse xpos, and current baseline to mouse ypos
--
Institute of Policy and Planning Sciences
http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
My nostalgia for Icon makes me forget about any of the bad things. I don't
have much nostalgia for Perl, so its faults I remember. Scott Gilbert c.l.py