From: Donald G Porter <dgp@em...> - 2003-12-15 17:07:03
> Tk's text widget uses "word" in several ways:
> 1. selection by word (double-click + drag),
> 2. movement by word ('insert wordstart'),
> 3. regexp searching with \m\M wordmatching.
> 4. line breaks when wrapping (-wrap word)
> It is not at all clear from reading Tcl or Tk's documentation what the
> behaviour of the above options will be. It turns out that:
> 1. after a convoluted call-chain, ends up calling
> tcl_wordBreakAfter/Before which use tcl_wordchars and tcl_nonwordchars.
> 2. uses 'isalnum(char)' or '_' to define a word (hard-coded in Tk's
> 3. uses Tcl's regexp engine's definition of a word.
> 4. Anything separated by white-space from something else, used with '-wrap
> word' to define line-wrapping in text widgets (and canvases).
> It is quite likely that all three of the above are different under some
> circumstances or some platforms/locales, and certainly if the
> user/developer wants to create a text widget with a different word
> definition, they basically can't in any consistent way.
Thanks, Vince. That's the kind of clear explanation of the issue
that TIP 122 needs. Could you and/or the author update the TIP?
The focus is really on seeing what we can do to improve the consistency
of the [text] widget.
| Don Porter Mathematical and Computational Sciences Division |
| donald.porter@... Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
> Thanks, Vince. That's the kind of clear explanation of the issue
> that TIP 122 needs. Could you and/or the author update the TIP?
> The focus is really on seeing what we can do to improve the consistency
> of the [text] widget.
Not just the text widget, since I assume similar confusion exists in other
parts of tcl/tk. (But, if we can work out what needs doing to the text
widget, it'll probably be pretty clear what changes are required
The TIP still isn't in a state where it presents a clear-cut proposal (and
I hope the author can be persuaded to update it for that purpose), but at
least it shouldn't be an obvious withdrawal candidate right away...