From Newsgroup: gnu.emacs.help
emacs 27.2 on Opensuse 15.4, tcl.el like this:
;;; tcl.el --- Tcl code editing commands for Emacs
;; Copyright (C) 1994, 1998-2021 Free Software Foundation, Inc.
;; Author: Tom Tromey <
tromey@redhat.com>
;; Chris Lindblad <
cjl@lcs.mit.edu>
;; Maintainer:
emacs-devel@gnu.org
;; Keywords: languages tcl modes
In tcl-mode, the following code leads to incorrect indentation after the 'method' line:
# --- cut here/1 ---
proc xxx {} {
yyy {
method zzz
}
# previous line should indent like this, but stays at beginning of line
# --- cut here/1 ---
If I go on the line after "method zzz" and press TAB ('tcl-indent-command'), the line stays at the beginning of the line and does not indent like the previous 'method' line. If I change the 'method zzz' line to
e.g. 'xmethod zzz, the next line indents correctly.
If I change the code to
# --- cut here/2 ---
proc xxx {} {
yyy { method zzz }
# correct indent now
# --- cut here/2 ---
(which is the same as TCL is concerned), the indent works correctly
This has something to do with 'tcl-calculate-indent', which in turn in
some way uses 'tcl-proc-regexp' (containing amongst others the 'method' keyword), but I can't figure out the convoluted details of all the
functions called.
Maybe someone here can offer some insight or even a solution?
TNX
R'
--- Synchronet 3.21d-Linux NewsLink 1.2