Subject: Re: bug#23565: 24.5; tcl-end-of-defun and tcl-eval-defun doesn't work reliable

From: Rolf Ade <[email-masked]>
Date: Wed, 31 Jul 2019 00:45:54 +0200

Tom Tromey <[email-masked]> writes:
>>>>>> "Rolf" == Rolf Ade <[email-masked]> writes:
>
> Rolf> Indent the second line ("foo") with <Tab> and you get
> Rolf> do {
> Rolf>     foo
>
> Thanks for trying this.
> I suppose instead of the fix for the "namespace" thing, tcl-mode should
> maybe just looking at brace depth for indentation.  I will take a deeper
> look.

Despite #32035 this is still open with master of today (but not with
26.2). Completely legal and commen code at the beginning befor the first
word out of tcl-proc-list are not indented as expected. Examples:

do {
something
}

if {$argc != 0} {
puts stderr "usage: $argv0"
}

set options {
-foo "default"
-bar "bardefault"
}

Expected indentation would be of course something like:

do {
    something
}

if {$argc != 0} {
    puts stderr "usage: $argv0"
}

set options {
    -foo "default"
    -bar "bardefault"
}

After the first word out of tcl-proc-list in the buffer all that
examples above will be indented as expected, no misbehaviour any more.

I happily confirm again, that master hasn't the original problem of this
bug report. And I'd really love to see that fixed, after it has plagued
me for 20 years.

But I'm afraid that the cure (current behavior of master) is worse than
the problem (26.2).