Files
binutils-gdb/gdb/testsuite/lib
Tom de Vries 5ed142657c [gdb/testsuite] Remove useless indentation in lib/tuiterm.exp
In lib/tuiterm.exp we have:
...
namespace eval Term {
    variable ...
    ...
}
...
with everything within the namespace (which is basically the entire file)
indented, which wastes screen space and makes editing more involved.

We could maybe fix this by moving the "namespace eval Term" to tuiterm_env,
but I don't think it's a good idea to move it out of the file.

Another idea is to have the file include itself, wrapped in the namespace:
...
if { ![info exists Term::_in_namespace] } {
    namespace eval Term {
       # Read the rest of this file, wrapped in this namespace.
       variable _in_namespace
       set _in_namespace 1
       source $::srcdir/lib/tuiterm.exp
       unset _in_namespace
       return
    }
}

variable ...
...
but this was considered unnecessarily complex.

Fix this in the style of lib/ton.tcl and lib/completion-support.exp:
- only declare the variables in the namespace, and
- define the procs using a Term:: prefix.

As a side-effect, this works around an emacs bug that makes editing
lib/tuiterm.exp in its current form problematic because the auto-indentation
keeps removing required indentation of all but the first proc [1].

Tested on x86_64-linux.

[1] https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-11/msg01674.html
2025-08-14 18:38:30 +02:00
..