Tcl Source Code

View Ticket
Login
Ticket UUID: f88bc5ff886393242da3b4d4e9dd775b3152ee0d
Title: tcl_wordchars and tcl_nonwordchars
Type: Bug Created on: 2024-10-17 14:39:39
Submitter: apnadkarni Assigned to: jan.nijtmans
Subsystem: 69. Other Severity: Minor
Priority: 5 Medium Last modified: 2024-10-23 13:41:03
Status: Closed Closed by: jan.nijtmans
Resolution: Fixed Closed on: 2024-10-23 13:41:03
Version: 8.7
Description:

tcl_wordchars and tcl-nonwordchars are documented in the tclvars manpage. However,

% set tcl_wordchars
can't read "tcl_wordchars": no such variable

Does some package have to be loaded in order for these to be available (by word.tcl being sourced) in which case that should be documented? Or are they to be removed from the documentation?

As a follow-on, why does their definition (as per the manpage) differ between Windows and Unix?

User Comments:
jan.nijtmans added on 2024-10-18 15:38:15:

> Does some package have to be loaded in order for these to be available

No. The idea is: if you want to change those, just do:

   set ::tcl_wordchars {\w}
   set ::tcl_nonwordchars {\W}
   ::tcl::UpdateWordBreakREs

Why would you want to do that?

I don't see the function ::tcl::UpdateWordBreakREs documented anywhere

> As a follow-on, why does their definition (as per the manpage) differ between Windows and Unix?

That's not true any more, since [bc8560501f9f895a|this] commit. Aparently, the documentation was never adapted


jan.nijtmans added on 2024-10-18 16:57:35:

Actually, it's not even needed to document ::tcl::UpdateWordBreakREs. As soon as any of the wordchar functions is called, tcl_library/word.tcl is loaded and ::tcl::UpdateWordBreakREs is executed. Nothing special needs to be done.

So, the only thing that needs to be done is fix the documentation regarding the difference between Windows and UNIX: There is no difference any more


jan.nijtmans added on 2024-10-18 19:08:07:

Proposed doc fix [b2eab2cc8efe5728|here]


jan.nijtmans added on 2024-10-23 13:41:03:

Hopefully, the documentation is more clear now.