In article <v3g9tp$30ko4$[email protected]>,
Lawrence D'Oliveiro <[email protected]d> wrote:
On Sat, 1 Jun 2024 19:11:43 -0000 (UTC), Spiros Bousbouras wrote:
Scripting language , not macro language.
In Emacs, there is no difference: the macro language is the scripting >>language.
I don't care about "Emacs", but there *is* a difference.
Vim has both - a macro langauge and a scripting language - and they are different things that do different things.
In fact, Vim has many different scripting languages - including a brand new one in Vim9 - that I know next to nothing about.
Emacs had very early a very capable Lisp ...
Now the "Eastern Orthodox Editors" I referred to else-thread were
extended using Rexx, also a quite fully-fledged language, and, back in
the days, rather common on OS/2 and Amiga.
In my professional context (simulation of structural mechanics) the
situation is similar: There were tools with proprietary extension
languages (typically rather crippled) and others with more common/powerful/generic ones (Lisp, Tcl, Python). The former tools over
the decades have often changed to these "better" languages as well.
Interesting. I read some more about languages in vi and clones. It seems
that there is still the old "ex" style (giving commands with ":" as
prefix). This of course was very limited, [...]
:/^Start$/,$g/^# Key//Control-Key/s/Hello/Hello World/
On 03.06.2024 21:45, Axel Reichert wrote:
A little sed/awk knowledge helps. But that is the group next door.
(-:
An Awk solution of this 'ex' one-liner would be quite bulky.
Janis Papanagnou <[email protected]> writes:
:/^Start$/,$g/^# Key//Control-Key/s/Hello/Hello World/
A little sed/awk knowledge helps. But that is the group next door. (-:
Sure, ex is the line-editing version of vi, [...]
On Mon, 3 Jun 2024 23:18:35 +0200, Janis Papanagnou wrote:
On 03.06.2024 21:45, Axel Reichert wrote:
A little sed/awk knowledge helps. But that is the group next door.
(-:
An Awk solution of this 'ex' one-liner would be quite bulky.
Whenever somebody mentions “Awk”, I immediately think “Perl does everything that Awk does, just as concisely, and more besides”.
On Sun, 02 Jun 2024 07:42:09 +0200, Axel Reichert wrote:
Emacs had very early a very capable Lisp ...
Fun fact: the very earliest versions of Emacs predated Lisp. They were
built on a different language--TECO. If you thought Lisp syntax was weird, TECO was even weirder.
[SNIP]
In a more practical vein, later in this thread awk is discussed. Sounded vaguely familiar. Found that Gawk is installed on my Debian system.
Browsing the first ~30 pages of _Gawk: Effective AWK Programming_
[ https://www.gnu.org/software/gawk/manual/ ] suggests it would be an appropriate tool for a personal project [removing featuritis of a large
set of HTML files].
Its been so long since I last used awk, I'll effectively be starting
from scratch. Can anyone recommend a suitable tutorial?
[many many hits on a web search ;]
Don't understate the 'ex' editor (or 'ex'-mode in Vi). You can do
powerful things out of the box that you cannot do in normal mode!
Here's the "block delete" macro which deletes a rectangular block
from marked position `a as top left to `b as bottom right
Geoff Clare <[email protected]d> writes:
Here's the "block delete" macro which deletes a rectangular block
from marked position `a as top left to `b as bottom right
Cool!
But I understand that this was not available out of the box in vi? I am
very sure that vim can do all this (very handy!) rectangular magic, as
can Emacs. I cannot say since when for the latter.
Many advanced features start out as a keyboard macro, which then can be
cast into the extension language of choice. For Emacs, there is even a package which translates a keyboard macro into the equivalent Lisp
code. After all (as in vi), the keystrokes are just bound to some
low-level function call.
On Tue, 4 Jun 2024 19:06:55 +0200
Janis Papanagnou <[email protected]> wrote:
[... about "A ...]
Register a , not buffer A .
Note that :registers shows them in low case letters.
On 04.06.2024 19:31, Spiros Bousbouras wrote:
On Tue, 4 Jun 2024 19:06:55 +0200
Janis Papanagnou <[email protected]> wrote:
[... about "A ...]
Register a , not buffer A .
Yes, "register" not "buffer". - Thanks!
Browsing the first ~30 pages of _Gawk: Effective AWK Programming_
[ https://www.gnu.org/software/gawk/manual/ ] suggests it would be an appropriate tool for a personal project [removing featuritis of a large
set of HTML files].
Register a , not buffer A .
On Tue, 4 Jun 2024 06:43:11 -0500, Richard Owlett wrote:
Browsing the first ~30 pages of _Gawk: Effective AWK Programming_
[ https://www.gnu.org/software/gawk/manual/ ] suggests it would be an
appropriate tool for a personal project [removing featuritis of a large
set of HTML files].
I wouldn’t bother. Having spent some time learning Perl, I would say Perl does everything Awk/Gawk can do, just as concisely, and it can do more besides.
On Tue, 4 Jun 2024 17:31:29 -0000 (UTC), Spiros Bousbouras wrote:
Register a , not buffer A .
Interesting that Emacs also uses the term “register”. Here the term actually came from TECO, where they were called “Q-registers” because they
were accessed with the “Q” command. There were 26 of them, and each one held an integer and a string. Notice that this matches the Emacs concept, too.
Does vi/vim also derive its terminology from the same source, I wonder?
On 05.06.2024 01:19, Lawrence D'Oliveiro wrote:
On Tue, 4 Jun 2024 06:43:11 -0500, Richard Owlett wrote:
Browsing the first ~30 pages of _Gawk: Effective AWK Programming_
[ https://www.gnu.org/software/gawk/manual/ ] suggests it would be an
appropriate tool for a personal project [removing featuritis of a large
set of HTML files].
I wouldn’t bother. Having spent some time learning Perl, I would say Perl >> does everything Awk/Gawk can do, just as concisely, and it can do more
besides.
Yes, "it can do more"; but this is not necessarily a determining
argument for Richard (or for other folks new to Awk or Perl).
If all he wants to do is text processing why learn a tool (Perl)
that
* has a much more cryptic syntax
* is much more complex[*]
* requires a lot more time learning[**]
* is non-standard (may not be available on POSIX systems)[***]
It's certainly good to know a text processing tool like Awk.
Janis
[*] Richard already identified Awk to be the "appropriate tool",
so obviously no need for additional complexity or more features.
[**] Richard also said he already used Awk in the past, which is
an additional time saver beyond the inherent huge effort to learn
a large tool like Perl.
[***] Richard works on his his own Debian, so being non-standard
is no problem. But for people on standard POSIX systems it may be.
On 04.06.2024 13:43, Richard Owlett wrote:
In a more practical vein, later in this thread awk is discussed. Sounded
vaguely familiar. Found that Gawk is installed on my Debian system.
Yes, POSIX standard asks for availability of Awk; you find it
on any standard Unix.
GNU Awk is a quality tool.
Browsing the first ~30 pages of _Gawk: Effective AWK Programming_
[ https://www.gnu.org/software/gawk/manual/ ] suggests it would be an
appropriate tool for a personal project [removing featuritis of a large
set of HTML files].
Its been so long since I last used awk, I'll effectively be starting
from scratch. Can anyone recommend a suitable tutorial?
The book you mentioned above doesn't suit you?
[many many hits on a web search ;]
I have bad experience with Web tutorials and their quality. :-/
Personally I got the first edition of the original book on The
Awk Programming Language, from Weinberger, Kernighan, and Aho
(from around 1988, I think). Meanwhile there's a recent 2nd ed.
It is well written (but quite expensive). The 200 page 1st ed.
had a 20 pages tutorial and a 45 pages language description,
which had been all I needed.
Janis
On Tue, 4 Jun 2024 21:00:09 +0200
Janis Papanagnou <[email protected]> wrote:
The term "register" isn't mentioned at all in the POSIX document.
Interesting. I wonder which vi clones call it "buffer" and which
"register". There may even exist more terminologies for all I know.
In my Vi/Vim lecture document I used (coined?) the term "paste-
buffer" to better differentiate it from "buffer" or "edit buffer".
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 716 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 52:23:40 |
| Calls: | 12,115 |
| Calls today: | 6 |
| Files: | 15,010 |
| Messages: | 6,518,589 |
| Posted today: | 1 |