Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

A Tcl editing aid?

135 views
Skip to first unread message

Richard Owlett

unread,
Sep 15, 2018, 6:30:28 AM9/15/18
to
I'm looking for an editing aid which may not be a complete editor.
I am generally very happy with a fairly basic editor [currently using
Pluma which is the default under the MATE Desktop on Debian].

I have problems matching a "}" with the *CORRECT* "{" when nested.
A while back I was experimenting with editors and came across one which
auto-indented and drew a light line from "{" to 'matching'(sic) "}".
I.E. syntactically correct but not always the desired match.

I deleted that editor as having too many "bells and whistles" to be
usable. I can't recall it's name nor the links leading to it. If I came
across it again I would use it to _LOOK_ at code.

I want a display tool more than an editing tool. It would auto-indent
and emphasize in some manner which pair of braces 'matched'.

Suggestions?
TIA


Christian Gollwitzer

unread,
Sep 15, 2018, 7:55:22 AM9/15/18
to
Am 15.09.18 um 12:30 schrieb Richard Owlett:
> I'm looking for an editing aid which may not be a complete editor.
> I am generally very happy with a fairly basic editor [currently using
> Pluma which is the default under the MATE Desktop on Debian].
>
> I have problems matching a "}" with the *CORRECT* "{" when nested.

Practically all serious text editors have such a feature, I'm surprised
the one you mentioned does not. I don't know PLuma, but gedit e.g.
highlights the matching brace when you put the cursor on one brace. It
must be switched on under thre stripe menu->Preferences->Bracket
matching, though.

Christian

Richard Owlett

unread,
Sep 15, 2018, 9:05:34 AM9/15/18
to
Not sure which is more appropriate, *ROFL* or "weeping with teeth gnashing".
Murphy has been having fun at my expense ;<

I hadn't spotted the option when I tried gedit yesterday.
As MATE is a Gnome fork, I double checked Pluma - it has it.
[As syntax highlighting was active I ASSUMED all tools were.
Therefore hadn't gone looking for it. OOOPS ;/]

How to chase logic flaws ;}
*THANK YOU!!!!*



Roderick

unread,
Sep 15, 2018, 9:46:30 AM9/15/18
to


On Sat, 15 Sep 2018, Richard Owlett wrote:

> I want a display tool more than an editing tool. It would auto-indent and
> emphasize in some manner which pair of braces 'matched'.
>
> Suggestions?

Emacs?

Richard Owlett

unread,
Sep 15, 2018, 10:27:43 AM9/15/18
to
<chuckle>
When I've seen it mentioned in other contexts I always visualized a
powerful character mode editor similar to DEC's TECO of the mid 70's.
Low and behold, the site's history page says it started life as TECO
macros. I didn't know it had a GUI interface.

Pluma can handle my current problems. One of the goals of my current
project is improved Tcl fluency so I'll delay investigating anything
that powerful.


Gerald Lester

unread,
Sep 15, 2018, 11:11:59 AM9/15/18
to
TECO and the TECO based EMACS are both available for Linux.

--
+----------------------------------------------------------------------+
| Gerald W. Lester, President, KNG Consulting LLC |
| Email: Gerald...@kng-consulting.net |
+----------------------------------------------------------------------+

Gerald Lester

unread,
Sep 15, 2018, 11:13:09 AM9/15/18
to
On 09/15/2018 10:11 AM, Gerald Lester wrote:
> On 09/15/2018 09:27 AM, Richard Owlett wrote:
>> On 09/15/2018 08:40 AM, Roderick wrote:
>>>
>>>
>>> On Sat, 15 Sep 2018, Richard Owlett wrote:
>>>
>>>> I want a display tool more than an editing tool. It would
>>>> auto-indent and emphasize in some manner which pair of braces
>>>> 'matched'.
>>>>
>>>> Suggestions?
>>>
>>> Emacs?
>>>
>>
>> <chuckle>
>> When I've seen it mentioned in other contexts I always visualized a
>> powerful character mode editor similar to DEC's TECO of the mid 70's.
>> Low and behold, the site's history page says it started life as TECO
>> macros. I didn't know it had a GUI interface.
>>
>> Pluma can handle my current problems. One of the goals of my current
>> project is improved Tcl fluency so I'll delay investigating anything
>> that powerful.
>
> TECO and the TECO based EMACS are both available for Linux.

Also, there is a add-in to add TECO "mode" into a ELISP based EMACS.

Richard Owlett

unread,
Sep 15, 2018, 12:27:16 PM9/15/18
to
On 09/15/2018 10:11 AM, Gerald Lester wrote:
> On 09/15/2018 09:27 AM, Richard Owlett wrote:
>> On 09/15/2018 08:40 AM, Roderick wrote:
>>>
>>>
>>> On Sat, 15 Sep 2018, Richard Owlett wrote:
>>>
>>>> I want a display tool more than an editing tool. It would
>>>> auto-indent and emphasize in some manner which pair of braces
>>>> 'matched'.
>>>>
>>>> Suggestions?
>>>
>>> Emacs?
>>>
>>
>> <chuckle>
>> When I've seen it mentioned in other contexts I always visualized a
>> powerful character mode editor similar to DEC's TECO of the mid 70's.
>> Low and behold, the site's history page says it started life as TECO
>> macros. I didn't know it had a GUI interface.
>>
>> Pluma can handle my current problems. One of the goals of my current
>> project is improved Tcl fluency so I'll delay investigating anything
>> that powerful.
>
> TECO and the TECO based EMACS are both available for Linux.
>

Go back to a character based editor? I'd prefer not.
However, does one of the varieties of EMACS available in Debian have the
advantage of a GUI *AND* the program creating capabilities of TECO -
browsing Synaptic didn't make it apparent.


Robert Heller

unread,
Sep 15, 2018, 1:04:29 PM9/15/18
to
What do you mean by "program creating capabilities"? *Any* text editor can be
used to create program source code. *Most* versions of EMACS (including
JASSPA MircoEmacs, based on Daniel Lawrence's original MicroEmacs 3.8), are
extendable (eg they include some sort of programmable scripting language).

Almost all modern text editors are in fact "modeless" character based editors,
whether they have point-and-click GUIs or not. The *original* TECO was NOT a
"modeless" character based editor, but was a command-based buffer editor. The
original editor macros for TECO (the precursor to EMACS) was one of the
earliest modeless character based editors. Vi is actually a command-based line
editor.

>
>
>

--
Robert Heller -- 978-544-6933
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
hel...@deepsoft.com -- Webhosting Services

Richard Owlett

unread,
Sep 15, 2018, 2:45:41 PM9/15/18
to
Back in the day TECO could take on anything BASIC could do.
Though I've not seen TECO in four decades, I suspect it would be at
least as suitable as Tcl for my current project.

For perspective, my formal CS <term used *loosely*> background includes
CORC/CUPL at Cornell in early 60's and a night school semester of
FORTRAN in early/mid 60's.

> *Any* text editor can be
> used to create program source code. *Most* versions of EMACS (including
> JASSPA MircoEmacs, based on Daniel Lawrence's original MicroEmacs 3.8), are
> extendable (eg they include some sort of programmable scripting language).
>
> Almost all modern text editors are in fact "modeless" character based editors,
> whether they have point-and-click GUIs or not. The *original* TECO was NOT a
> "modeless" character based editor, but was a command-based buffer editor. The
> original editor macros for TECO (the precursor to EMACS) was one of the
> earliest modeless character based editors. Vi is actually a command-based line
> editor.

You speak CS. I don't ;/

I worked for DEC in the 70's. I got an interview because I had no
interest/qualification in 'digital' realm. But power supplies of the day
were primarily linear analog creations. If you used a PDP 11/45 of
suitable vintage (i.e. H720E power supply), you benefited. [If you ever
looked at the schematic of a later H720E and wondered about the presence
of a thermistor where there would be a forward biased diode ...]

skuh...@web.de

unread,
Sep 15, 2018, 3:05:02 PM9/15/18
to
Am Samstag, 15. September 2018 18:27:16 UTC+2 schrieb Richard Owlett:
> However, does one of the varieties of EMACS available in Debian have the
> advantage of a GUI *AND* the program creating capabilities of TECO -
> browsing Synaptic didn't make it apparent.

Yes, all of them... Just use the most generic version, GNUEmacs 26.x. You can use it like a modern GUI based editor (default setup with no customized config-file has menus, toolbars, tooltips, mouse editing... you name it. But you also can use all the power of text only based editing or create your own macros (syntax differs from TECO, of course).But chance is, that everything you can imagine is already there. - About emacs there could be a whole set of university-studies and it would take quite a few years to master it... :-)
Anyway, it is my allround-tool for editing everything - especially Tcl, since its Tcl-mode is excellent.

Richard Owlett

unread,
Sep 15, 2018, 3:13:36 PM9/15/18
to
IOW If TECO could do it, EMACS can?

Considering that I've not seen TECO in decades, can EMACS satisfy
expectations for/of TECO?

Suspect answer is "Yes".

skuh...@web.de

unread,
Sep 15, 2018, 3:19:50 PM9/15/18
to
> Considering that I've not seen TECO in decades, can EMACS satisfy
> expectations for/of TECO?
>
> Suspect answer is "Yes".

Yes. Emacs' extension language is (Emacs-)Lisp (sadly, not Tcl... I'm working on that...), which is Turing-complete, so it can do everything, that can be done with a computer. All of Emacs' editing capabilities can be used there, in fact, most of Emacs functionality is implemented in Lisp. And the possibilities of its API go far beyond text-manipulation commands.

But be warned: Emacs is not only a very (or the most) powerful editor, it is also overwhelming with its possibilities and highly addictive, once you understood the idea... Very much like Tcl. :-)

Robert Heller

unread,
Sep 15, 2018, 4:03:21 PM9/15/18
to
At Sat, 15 Sep 2018 14:13:28 -0500 Richard Owlett <row...@cloud85.net> wrote:

>
> On 09/15/2018 02:04 PM, skuh...@web.de wrote:
> > Am Samstag, 15. September 2018 18:27:16 UTC+2 schrieb Richard Owlett:
> >> However, does one of the varieties of EMACS available in Debian have the
> >> advantage of a GUI *AND* the program creating capabilities of TECO -
> >> browsing Synaptic didn't make it apparent.
> >
> > Yes, all of them... Just use the most generic version, GNUEmacs 26.x. You can use it like a modern GUI based editor (default setup with no customized config-file has menus, toolbars, tooltips, mouse editing... you name it. But you also can use all the power of text only based editing or create your own macros (syntax differs from TECO, of course).But chance is, that everything you can imagine is already there. - About emacs there could be a whole set of university-studies and it would take quite a few years to master it... :-)
> > Anyway, it is my allround-tool for editing everything - especially Tcl, since its Tcl-mode is excellent.
> >
>
> IOW If TECO could do it, EMACS can?

Probably.

>
> Considering that I've not seen TECO in decades, can EMACS satisfy
> expectations for/of TECO?
>
> Suspect answer is "Yes".
>

Probably.

Roderick

unread,
Sep 15, 2018, 4:16:30 PM9/15/18
to


On Sat, 15 Sep 2018, skuh...@web.de wrote:

> But be warned: Emacs is not only a very (or the most) powerful editor,

Yes, for beeing a complete operating system is only necessary to
add a kernel. Perhaps it is not a bad idea to call it as login shell
in a computer with meager user land programms.

Well, I never used teco, but an editor called sos in the DEC 10. It was
enough. Then ed in Unix, and then emacs, a big step. Today a little vi.
I think, due to its weight, I would not decide to use emacs today, but
due to the wight of the time using it, I do.

Other alternatives, but perhaps not what the OP wants: sam, acme.

Rodrigo

Rolf Ade

unread,
Sep 15, 2018, 7:19:19 PM9/15/18
to

skuh...@web.de writes:
> [About emacs]
> Anyway, it is my allround-tool for editing everything - especially
> Tcl, since its Tcl-mode is excellent.

"Excellent" is an exaggeration - I'm writing this as one that uses emacs
to write Tcl almost daily.

On the editing side (navigation, indentation, syntax highlighting etc)
it isn't exceptional at all. And it even has some quirks e.g.

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=23565

Where it in fact truly shines is running your Tcl programs from within
emacs with the interpreter prompt as emacs buffer for direct
communication. Evaluating code from your Tcl buffers in the running
interpreter makes developing, testing and debugging a pleasure.

Ricardo kozmate.net

unread,
Sep 15, 2018, 8:54:09 PM9/15/18
to
Em 15/09/18 11:30, Richard Owlett escreveu:
> I have problems matching a "}" with the *CORRECT* "{" when nested.

Does SciTE, which I mentioned in another thread, has that problem?

Anyway, when does it happen? Sometimes (even) Emacs gets confused, e.g.
if there are brackets within strings.

(I don't use SciTE for a while, but use Emacs often.)

--
{ricardo from kozmate.net}

Richard Owlett

unread,
Sep 16, 2018, 1:21:50 AM9/16/18
to
On 09/15/2018 07:54 PM, Ricardo kozmate.net wrote:
> Em 15/09/18 11:30, Richard Owlett escreveu:
>> I have problems matching a "}" with the *CORRECT* "{" when nested.
>
> Does SciTE, which I mentioned in another thread, has that problem?

Yes. No. Maybe.
I have problems with Scite , and others, guessing what files have been
recently opened.
Having been pointed to right option, :Pluma handles my problems.

Christian Gollwitzer

unread,
Sep 16, 2018, 1:46:33 AM9/16/18
to
Am 16.09.18 um 01:19 schrieb Rolf Ade:
>
> skuh...@web.de writes:
>> [About emacs]
>> Anyway, it is my allround-tool for editing everything - especially
>> Tcl, since its Tcl-mode is excellent.
>
> "Excellent" is an exaggeration

That is just because "you should not use Tcl"

;)
SCNR

skuh...@web.de

unread,
Sep 16, 2018, 7:20:41 AM9/16/18
to
Am Sonntag, 16. September 2018 07:46:33 UTC+2 schrieb Christian Gollwitzer:
> Am 16.09.18 um 01:19 schrieb Rolf Ade:
> That is just because "you should not use Tcl"
>
> ;)

Yeah, I never understood RMS' aversion against Tcl, even less after I read his "essay"-rant against Tcl, where this citation comes from. He is a brilliant brain, but he is simply wrong with that. Maybe only jealous, that Tcl (or something as simple and elegant) wasn't his idea. Don't know...

skuh...@web.de

unread,
Sep 16, 2018, 7:26:16 AM9/16/18
to
Am Sonntag, 16. September 2018 01:19:19 UTC+2 schrieb Rolf Ade:
> "Excellent" is an exaggeration - I'm writing this as one that uses emacs
> to write Tcl almost daily.

Well, it is not perfect, but that's a problem with Tcl flexible syntax, where highlighting can not always be perfect, if you don't actually interpret the Tcl-script, because with [rename] you never really know, what a token means, including braces.

However, *inferior-tcl* was mentioned (the buffer for interpreting Tcl and the in place-evaluation) - those are not really part of the pure Tcl-mode, granted... But when I said Tcl-mode in Emacs, all that together was what I really meant. Emacs is a great environment for working with Tcl. - I even have my org-mode in Emacs interpreting Tcl, so that I can have in-place-evaluation of scripts inside the org-structures. Powerful stuff.

Rich

unread,
Sep 16, 2018, 11:11:04 AM9/16/18
to
My take on it was that his aversion was due to Tcl's licence (not GNU
GPL) and Sun Microsystem's public statements of trying to push Tcl
everywhere (this was just before they invented Java, and yes, for a
brief moment Tcl was being pushed by Sun to be what Java became).

RMS, if you consider his thought process from a "preserve freedoms"
perspective would have had issues with non-GPL licenced languages being
pushed to "everywhere" because from his vantage point, Tcl's BSD
licence does not require future users/adopters to contribute back to
the betterment of the community as a whole.

Note: I'm not trying to start a GPL vs BSD flamewar, just trying to
convey my understanding of why I think RMS had the issues he had with
Tcl at the time he had the issues.

skuh...@web.de

unread,
Sep 16, 2018, 2:08:43 PM9/16/18
to
You are very probably right. RMS has a very clear opinion about licensing. However, I remember a text about Tcl from him (read many years ago), where he also was very clear that he dislikes Tcl also because of what it is, not only because of its license. - If that were the only problem, he could have just suggested, that someone creates a GPL-Version of Tcl, since the definition of the syntax and the meaning of procedure-names is visible to everyone, without breaking a license.

Anyway, he has as everybody the right to like or dislike any programming language he wants. I'm okay with that, but I think, he is wrong about Tcl.

By the way, I remember the time, when Sun pushed Tcl and was shocked, when they decided to go all Java. I mean, I loved the idea of Java at first, but then its elegance was destroyed by all the bloat and I was really disappointed. Looking back, I should be happy, that Sun decided for Java. It would have been a real tragedy, if Tcl would have gone the same way.

Robert Heller

unread,
Sep 16, 2018, 2:25:34 PM9/16/18
to
I think another piece of it is that RMS is/was part of the camp that LISP
should be the universal language used for everything, everywhere. Note: Tcl
has some vague similarities to LISP -- both pretty much have no formal
"syntax" and no "reserved words", both are prefix languages, both are
extensible by redefining any function, etc. From a *certain* perspective, Tcl
looks like reinventing the [LISP] wheel (sort of).

skuh...@web.de

unread,
Sep 16, 2018, 4:24:33 PM9/16/18
to
I found RMS' rant against Tcl - he posted it in this very newgroup... I couldn't remember that: https://groups.google.com/d/msg/comp.lang.tcl/7JXGt-Uxqag/3JBTj5I43yAJ

But that is 24 years ago, so Tcl has changed a lot, and maybe RMS would come to another conclusion about the language itself (despite the license). Although I somehow doubt that...

To the OP: TECO is also a topic in RMS' post. And he answers your question "if TECO can do, can Emacs" also there very clearly: Of course, it can :-)

Uwe Klein

unread,
Sep 17, 2018, 8:05:03 AM9/17/18
to
Am 16.09.2018 um 20:08 schrieb skuh...@web.de:
> Anyway, he has as everybody the right to like or dislike any
> programming language he wants. I'm okay with that, but I think, he is
> wrong about Tcl.
>
RMS was rather religious ( and like any religion ) ignored reality
in that context.

Tcl is a much better fit with engineering
and the occasional user than Scheme/Guile.

That has IMHO maimed the gEDA suite and
other principally useful/desirable tools like GnuCash.


for the chips and beer while watching faction:
https://vanderburg.org/old_pages/Tcl/war/

Uwe

Ricardo kozmate.net

unread,
Sep 17, 2018, 5:45:39 PM9/17/18
to
Em 16/09/18 06:21, Richard Owlett escreveu:
> :Pluma handles my problems.

So... using a feather to tickle.

Makes sense :-)

--
{ricardo from kozmate.net}

Roderick

unread,
Sep 18, 2018, 1:00:14 PM9/18/18
to

Now, that we are on the thema emacs, I have a question:
How to disable the indentation in tcl-mode?

I have my own indentation style and the autoindentation is annoying.

BTW. That is another thing of emacs: after every mayor release I have
to struggle to get a configuration in order that behave as I am used.

Rodrigo

skuh...@web.de

unread,
Sep 18, 2018, 2:50:53 PM9/18/18
to
Am Dienstag, 18. September 2018 19:00:14 UTC+2 schrieb Roderick:
> Now, that we are on the thema emacs, I have a question:
> How to disable the indentation in tcl-mode?
>
> I have my own indentation style and the autoindentation is annoying.

(setq tcl-indent-level 0)

> BTW. That is another thing of emacs: after every mayor release I have
> to struggle to get a configuration in order that behave as I am used.

I only experienced this a few times in many years, but it sure is annoying. Something like a "migrate-settings" command would be wonderful (and pretty hard to implement...)

Roderick

unread,
Sep 18, 2018, 3:29:01 PM9/18/18
to


On Tue, 18 Sep 2018, skuh...@web.de wrote:

> (setq tcl-indent-level 0)

I put it in .emacs, but unfortunately it does not work.

Rich

unread,
Sep 18, 2018, 3:35:32 PM9/18/18
to
You might consider asking your question in an emacs group (there might
be more possible users there with answers/tips).

A quick scan shows these possibilities:

comp.emacs
gnu.emacs.help
alt.religion.emacs

Roderick

unread,
Sep 18, 2018, 3:52:21 PM9/18/18
to


On Tue, 18 Sep 2018, Rich wrote:

> You might consider asking your question in an emacs group (there might
> be more possible users there with answers/tips).

It depends on tcl-mode. I wonder that all tcl programmers using emacs
let emacs dictate them how to indent.

The solution is to use the fundamental mode, but even this began
to indentate in the last versions. With some work I disabled it.

An editor should write what the user wants to write. I hate
programs that supose the user is stupid and take decisions
for him.

Rodrigo

Rolf Ade

unread,
Sep 18, 2018, 6:40:27 PM9/18/18
to

Roderick <hru...@gmail.com> writes:
> Now, that we are on the thema emacs, I have a question:
> How to disable the indentation in tcl-mode?

Depends a bit on what exactly you mean.

> I have my own indentation style and the autoindentation is annoying.

This suggests that you maybe just be annoyed by electric-indent-mode. So
turn it of:

(setq electric-indent-mode nil)

Or, to change locally for one buffer: M-x electric-indent-mode.

No autoindentation anymore. If you hit <TAB>, though, it will be indent
according the rules of the major-mode. If you dislike this as well
rebind <TAB>.

Roderick

unread,
Sep 19, 2018, 3:04:35 AM9/19/18
to


On Wed, 19 Sep 2018, Rolf Ade wrote:

> This suggests that you maybe just be annoyed by electric-indent-mode. So
> turn it of:
>
> (setq electric-indent-mode nil)

I have since long time

(setq-default indent-tabs-mode t)
(electric-indent-mode -1)

in order that emacs do not add tabs at the left after a line with a
tab. If I do what you say, it begins doing it again.

What I want?! That emacs write exactly what I type and nothing else.

Also the wasting of time trying to configure emacs for this simple
goal is annoying. Its weight.

Rodrigo

skuh...@web.de

unread,
Sep 19, 2018, 9:21:05 AM9/19/18
to
> What I want?! That emacs write exactly what I type and nothing else.
>
> Also the wasting of time trying to configure emacs for this simple
> goal is annoying. Its weight.

Maybe you simply shouldn't use emacs then for editing Tcl...? There other editors (sorry, RMS...) without any knowledge of Tcl and no customized key-tables. OTOH, maybe text-mode does what you want, its pretty straight forward.

Roderick

unread,
Sep 19, 2018, 11:01:39 AM9/19/18
to

On Wed, 19 Sep 2018, skuh...@web.de wrote:

> Maybe you simply shouldn't use emacs then for editing Tcl...?

Or not at all. Emacs developed into a cool editor full of features.

I use it only for the following reasons:

1. I think many developers in many OS use it and hence it is reliable
(I do not want my files be spoiled).

2. After so many years using it, I am used to EMACS (Escape Meta
Alt Control Shift).

3. Complicated Search and Replace functions with regular
expresions across lines works good. I do not know if (n)vi
is so comfortable.

Perhaps sam is an alternative, but it is a port from plan9, I do not
know if it is reliable in other OS.

Rodrigo.

Roderick

unread,
Sep 19, 2018, 11:08:07 AM9/19/18
to

And they wanted Guile to replace Tcl. I think there were plans to
port emacs to Guile. But still now you see in Emacs a brocken
Lisp dialect. They expended more time inflating it putting cool
features than repairing it.


0 new messages