Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Insufficient facts always invite danger. -- Spock, "Space Seed", stardate 3141.9


devel / comp.lang.tcl / Re: slightly OT: TCL code indent in emacs 27.2

SubjectAuthor
* slightly OT: TCL code indent in emacs 27.2Ralf Fassel
+* slightly OT: TCL code indent in emacs 27.2Joerg Mertens
|`- slightly OT: TCL code indent in emacs 27.2Ralf Fassel
`* slightly OT: TCL code indent in emacs 27.2Ricardo kozmate.net
 `* slightly OT: TCL code indent in emacs 27.2Ralf Fassel
  `- slightly OT: TCL code indent in emacs 27.2Ricardo kozmate.net

1
slightly OT: TCL code indent in emacs 27.2

<ygay1sd301v.fsf@akutech.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10149&group=comp.lang.tcl#10149

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.mixmin.net!news2.arglkargh.de!news.karotte.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: ralf...@gmx.de (Ralf Fassel)
Newsgroups: comp.lang.tcl
Subject: slightly OT: TCL code indent in emacs 27.2
Date: Mon, 14 Nov 2022 18:42:20 +0100
Lines: 44
Message-ID: <ygay1sd301v.fsf@akutech.de>
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: individual.net VA+k4cFJBXeug/Io74I6RwB7e2JoAmnLwpfovo6Q+zZ4iQl2g=
Cancel-Lock: sha1:ZGiBnfQk+f18AjJlirMqFwJ6hcY= sha1:VGtOTHgCLzZt8N1I017bjx7Y05o=
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
 by: Ralf Fassel - Mon, 14 Nov 2022 17:42 UTC

Any emacs users here who have hit this before?
If so, how did you solve it?

emacs 27.2 on Linux/Opensuse 15.4 and tcl.el like this:

;;; tcl.el --- Tcl code editing commands for Emacs
;; Copyright (C) 1994, 1998-2021 Free Software Foundation, Inc.

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'

Re: slightly OT: TCL code indent in emacs 27.2

<87o7t9cmng.fsf@joerg-mertens.dialin.t-online.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10152&group=comp.lang.tcl#10152

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: joerg-me...@t-online.de (Joerg Mertens)
Newsgroups: comp.lang.tcl
Subject: Re: slightly OT: TCL code indent in emacs 27.2
Date: Mon, 14 Nov 2022 21:21:39 +0100
Organization: privat
Lines: 26
Message-ID: <87o7t9cmng.fsf@joerg-mertens.dialin.t-online.de>
References: <ygay1sd301v.fsf@akutech.de>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="4f07ef5229bd5273e5034e6f7b3f4377";
logging-data="1932837"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX182D/zX5eLjI0CMquMbOIf89mvxsu19rBQ="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (berkeley-unix)
Cancel-Lock: sha1:EbS/Tc33aPW/+VAHAJ17+MP3qKc=
sha1:IGNiaXkv8ZZuV7dzhO0WS6M+XQk=
 by: Joerg Mertens - Mon, 14 Nov 2022 20:21 UTC

Ralf Fassel <ralfixx@gmx.de> writes:

> emacs 27.2 on Linux/Opensuse 15.4 and tcl.el like this:
>
> ;;; tcl.el --- Tcl code editing commands for Emacs
> ;; Copyright (C) 1994, 1998-2021 Free Software Foundation, Inc.
>
> 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 ---

Works correctly in Emacs 28.2. tcl.el is from 2022 in this version. I
had 27.something until a few weeks ago and I don't remember this
problem having occured here. I don't use Tcl that often, though.

Maybe try running emacs -Q to eliminate the possibility it has something
to do with your configuration.

Joerg

Re: slightly OT: TCL code indent in emacs 27.2

<ygazgckv99g.fsf@akutech.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10215&group=comp.lang.tcl#10215

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: ralf...@gmx.de (Ralf Fassel)
Newsgroups: comp.lang.tcl
Subject: Re: slightly OT: TCL code indent in emacs 27.2
Date: Mon, 21 Nov 2022 12:26:19 +0100
Lines: 30
Message-ID: <ygazgckv99g.fsf@akutech.de>
References: <ygay1sd301v.fsf@akutech.de>
<87o7t9cmng.fsf@joerg-mertens.dialin.t-online.de>
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: individual.net MEsX49FRAEFMcaz1qUtI+ACgajlpllmBjcKdfKX7oQsF+nMLE=
Cancel-Lock: sha1:i+czcojYwFNpwvalsp1vcj67luA= sha1:/k/zzIb/eFW+MKk7v0aXA7aId0c=
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
 by: Ralf Fassel - Mon, 21 Nov 2022 11:26 UTC

* Joerg Mertens <joerg-mertens@t-online.de>
| Ralf Fassel <ralfixx@gmx.de> writes:
>
| > emacs 27.2 on Linux/Opensuse 15.4 and tcl.el like this:
| >
| > ;;; tcl.el --- Tcl code editing commands for Emacs
| > ;; Copyright (C) 1994, 1998-2021 Free Software Foundation, Inc.
| >
| > 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 ---
>
| Works correctly in Emacs 28.2. tcl.el is from 2022 in this version.

So there is hope... :-)

| Maybe try running emacs -Q to eliminate the possibility it has
| something to do with your configuration.

First thing I tried: emacs -q --no-site-file

TNX
R'

Re: slightly OT: TCL code indent in emacs 27.2

<tlfpa4$eh8$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10216&group=comp.lang.tcl#10216

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!b8Rjt2t2+VoVF7RXaZXqhg.user.46.165.242.75.POSTED!not-for-mail
From: rica...@kozmate.net (Ricardo kozmate.net)
Newsgroups: comp.lang.tcl
Subject: Re: slightly OT: TCL code indent in emacs 27.2
Date: Mon, 21 Nov 2022 12:01:07 +0000
Organization: Aioe.org NNTP Server
Message-ID: <tlfpa4$eh8$1@gioia.aioe.org>
References: <ygay1sd301v.fsf@akutech.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="14888"; posting-host="b8Rjt2t2+VoVF7RXaZXqhg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.2.2
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US, pt-PT
 by: Ricardo kozmate.net - Mon, 21 Nov 2022 12:01 UTC

Em 14/11/22 17:42, Ralf Fassel escreveu:
> 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 ---

Same here, also with emacs 27.2 (over Linux OpenSuse Leap 15.4)

Emacs is a great help but it has a quirk here and there, namely with
indentation, though I can't remember any by heart right now.

Usually I just play along. Given that I only make short stuff and by
myself, thus not needing to conform to any given style, that is OK.
Although I'd rather be strict as to style choice.

As to your example I note that yyy is not a keyword. Starting with a
known keyword might work as expected:

proc xxx {} {
list xxx {
yyy
zzz
}
}

and...

proc xxx {} {
set L [list xxx {
yyy
zzz
}]
}

or not...

proc xxx {} {
set L [list xxx {
yyy
zzz
}
]
}

Wow! :o

Not important to me right now, so I'll probably wait for the
distribution's update (early summer usually) to also update emacs

--
{ricardo from kozmate.net}

Re: slightly OT: TCL code indent in emacs 27.2

<ygav8n8v3cu.fsf@akutech.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10217&group=comp.lang.tcl#10217

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!lilly.ping.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: ralf...@gmx.de (Ralf Fassel)
Newsgroups: comp.lang.tcl
Subject: Re: slightly OT: TCL code indent in emacs 27.2
Date: Mon, 21 Nov 2022 14:33:53 +0100
Lines: 31
Message-ID: <ygav8n8v3cu.fsf@akutech.de>
References: <ygay1sd301v.fsf@akutech.de> <tlfpa4$eh8$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: individual.net JYDDz2wDxX+CjOK5/zhWuwokd9yXmuOT1X8m1lFbcGOHTiskA=
Cancel-Lock: sha1:kLPaN7lzWu8ww40HIlGQu+oDRzM= sha1:Mnb1prokI4mb8yiXONSExA2Kj7g=
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
 by: Ralf Fassel - Mon, 21 Nov 2022 13:33 UTC

* "Ricardo kozmate.net" <ricardo@kozmate.net>
| Em 14/11/22 17:42, Ralf Fassel escreveu:
| > 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 ---
>
| Same here, also with emacs 27.2 (over Linux OpenSuse Leap 15.4)

As Joerg Mertens mentioned in the other message, this seems to be fixed
in 28.2. I just downloaded the 28.2 tarball, extracted tcl.el and indeed,
this also works in 27.2. Since I don't want to mess with local copies
of system files, I just wait for the next release, too.

For those interested, I solved my 'problem' like this:

(add-hook 'tcl-mode-hook
(lambda ()
;; bug in 27.2 indenting, just remove the whole proc recognition thingy
(if (equal emacs-version "27.2")
(progn
(setq tcl-proc-list nil)
(tcl-set-proc-regexp)
(tcl-set-font-lock-keywords)))))

R'

Re: slightly OT: TCL code indent in emacs 27.2

<tlglaj$k2d$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10222&group=comp.lang.tcl#10222

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!b8Rjt2t2+VoVF7RXaZXqhg.user.46.165.242.75.POSTED!not-for-mail
From: rica...@kozmate.net (Ricardo kozmate.net)
Newsgroups: comp.lang.tcl
Subject: Re: slightly OT: TCL code indent in emacs 27.2
Date: Mon, 21 Nov 2022 19:59:15 +0000
Organization: Aioe.org NNTP Server
Message-ID: <tlglaj$k2d$1@gioia.aioe.org>
References: <ygay1sd301v.fsf@akutech.de> <tlfpa4$eh8$1@gioia.aioe.org>
<ygav8n8v3cu.fsf@akutech.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="20557"; posting-host="b8Rjt2t2+VoVF7RXaZXqhg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.2.2
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US, pt-PT
 by: Ricardo kozmate.net - Mon, 21 Nov 2022 19:59 UTC

Em 21/11/22 13:33, Ralf Fassel escreveu:
> Since I don't want to mess with local copies
> of system files, I just wait for the next release, too.

Precisely.

> For those interested, I solved my 'problem' like this:

Thanks. I might try soon-ish.

--
{ricardo from kozmate.net}

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor