Help isolating an exmh text selection problem on recent Tk

Chris Siebenmann <[email protected]> Fri, 17 Jun 2016 13:21:33 -0400
Newsgroups gmane.mail.exmh.user
Message-ID <[email protected]>
 I'm a long term exmh user, mostly on Ubuntu for the past few years.
We are in the process of updating from Ubuntu 14.04 to Ubuntu 16.04,
and on 16.04 I've found that my exmh install has an unfortunate bug in
text selection in the message display. The bug itself is that if you
double-click on the first word in a paragraph, Tk includes whitespace
before the word in the selection. If the first word is indented,
you get the whitespace from the start of the line to the word; if the
first word is not indented, you get the whitespace back to the previous
non-whitespace line (ie, you get an entire blank line).

(This doesn't happen if the 'word' is/starts with non-alphabetic
characters, like '>' or '-' or '*'.)

My current assumption is that exmh isn't doing anything weird with
selection handling in its Tk text widgets, so I expect that this is a
Tk bug and/or change in the Tk version that Ubuntu 16.04 has (8.6.5,
the latest version; 14.04 has 8.6.1 and doesn't have this problem),
and will have to be fixed or patched around by the Tk people. I intend
to report a bug to them (once I figure out how), but I'd like to have
a minimal test case for them.

So: does anyone know exmh Tk code well enough to tell me how it creates
and configures its message display text widgets? Armed with this
information I think I can create a minimal Tcl/TK program that creates
a text widget, puts some text in, and then lets you click/select away,
which should presumably reproduce this issue in a nice simple form for
the Tk people. I have tried to go through the Exmh code and I can sort
of see it doing things in eg lib/widgetText.tcl, but I am not a Tcl/TK
programmer and I know I'm missing things.

(For instance, I've read that you have to do some extra work to make a
text widget not editable, but I can't see this in the code. So either
I'm missing something in the code or I'm wrong in my understanding of Tk.)

 Thanks in advance. (And I'd be interested to know if anyone else
is seeing this issue.)

PS: In looking at the code some more, I suspect that this is some sort
of behavior change in the text widget 'wordstart' operation. There are
even some 2015 Tk changes in this area (apparently after 8.6.4 was
released):
 2015-04-09 (bug)[e4ed00] [$text index "1.0 display wordstart"] crash (vogel)
 2015-04-09 (bug)[562118] Unicode support of "wordstart" modifier (vogel)

	- cks