All of the great discussion on this list about editors has made me curious about the data structures used in the various Unix editors.
I found a great discussion of this for sam in Rob Pike’s publication “The Text Editor sam.”
I’d like to read similar discussions of the data structures for ed, em, ex/vi. If anyone has suggestions of references, they would be very welcome!
Similarly, if there are any pointers to references on some other data structures in editors like TECO, QED and E, I’d welcome them as well.
All the best,
David
...........
David C. Brock
Director and Curator
Software History Center
Computer History Museum
computerhistory.org/softwarehistory<http://computerhistory.org/softwarehistory>
Email: dbrock(a)computerhistory.org
Twitter: @dcbrock
Skype: dcbrock
1401 N. Shoreline Blvd.
Mountain View, CA 94943
(650) 810-1010 main
(650) 810-1886 direct
Pronouns: he, him, his
>From spaf(a)cs.purdue.EDU Thu Apr 4 23:11:22 1991
Path: ai-lab!mintaka!mit-eddie!wuarchive!usc!apple!amdahl!walldrug!moscvax!perdue!spaf
From: spaf(a)cs.purdue.EDU (Gene Spafford)
Newsgroups: news.announce.important,news.admin
Subject: Warning: April Fools Time again (forged messages on the loose!)
Message-ID: <4-1-1991(a)medusa.cs.purdue.edu>
Date: 1 Apr 91 00:00:00 GMT
Expires: 1 May 91 00:00:00 GMT
Followup-To: news.admin
Organization: Dept. of Computer Sciences, Purdue Univ.
Lines: 25
Approved: spaf(a)cs.purdue.EDU
Xref: ai-lab news.announce.important:19 news.admin:8235
Warning: April 1 is rapidly approaching, and with it comes a USENET
tradition. On April Fools day comes a series of forged, tongue-in-cheek
messages, either from non-existent sites or using the name of a Well Known
USENET person. In general, these messages are harmless and meant as a joke,
and people who respond to these messages without thinking, either by flaming
or otherwise responding, generally end up looking rather silly when the
forgery is exposed.
So, for the few weeks, if you see a message that seems completely out
of line or is otherwise unusual, think twice before posting a followup
or responding to it; it's very likely a forgery.
There are a few ways of checking to see if a message is a forgery. These
aren't foolproof, but since most forgery posters want people to figure it
out, they will allow you to track down the vast majority of forgeries:
o Russian computers. For historic reasons most forged messages have
as part of their Path: a non-existent (we think!) russian
computer, either kremvax or moscvax. Other possibilities are
nsacyber or wobegon. Please note, however, that walldrug is a real
site and isn't a forgery.
o Posted dates. Almost invariably, the date of the posting is forged
to be April 1.
o Funky Message-ID. Subtle hints are often lodged into the
Message-Id, as that field is more or less an unparsed text string
and can contain random information. Common values include pi,
the phone number of the red phone in the white house, and the
name of the forger's parrot.
o subtle mispellings. Look for subtle misspellings of the host names
in the Path: field when a message is forged in the name of a Big
Name USENET person. This is done so that the person being forged
actually gets a chance to see the message and wonder when he
actually posted it.
Forged messages, of course, are not to be condoned. But they happen, and
it's important for people on the net not to over-react. They happen at this
time every year, and the forger generally gets their kick from watching the
novice users take the posting seriously and try to flame their tails off. If
we can keep a level head and not react to these postings, they'll taper off
rather quickly and we can return to the normal state of affairs: chaos.
Thanks for your support.
Gene Spafford, Net.God (and probably tired of seeing this message)
> From: David C. Brock
> I'd like to read similar discussions of the data structures for ed, em,
> ex/vi. ... Similarly, if there are any pointers to references on some
> other data structures in editors like TECO, QED and E, I'd welcome them
> as well.
I don't have any discussions I can point you at, but I do have source - for
two things which are somewhat older than most of the ones you mention
(ex/vi/etc).
The first is a TECO from the fourth floor V6 machine (DSSR/RTS) at Tech Sq at
MIT:
http://ana-3.lcs.mit.edu/~jnc/tech/unix/teco
There's some rudimentary documentation in there, in teco.doc, but don't expect
too much. You'll have to rely on the source, which is in MACRO-11 - but it
seems to be reasonably well commented. This actually predates V6; it was
originally written for an MIT OS called DELPHI, which ran on an -11/45 which
was the main EECS undergrad machine. At some point (probably post the Unix
port), it was modified to have '^R mode', which was a WYSIWYG display mode a
lot like the one in the ITS TECO in which EMACS was first written.
I have also put up the Montgomery Emacs for Unix:
http://ana-3.lcs.mit.edu/~jnc/tech/unix/emacs
This is the version we were running on the 5th floor MIT V6 machine (CSR),
which by that point have absorbed a few V7isms (e.g. some ioctl() stuff). So
don't expect to be able to compile and run it, without a fair amount of
work. (I vaguely recall that it needs I+D space, so maybe not on a /23 at
all.) But at least the source is in C, so you can read it. I don't think
there's an un-modified version online (i.e. the original Montgomery source),
alas.
Noel
This just came in:
ACM has named Alfred Vaino Aho and Jeffrey David Ullman recipients of
the 2020 ACM A. M. Turing Award
https://awards.acm.org/about/2020-turing
for fundamental algorithms and theory underlying programming language
implementation and for synthesizing these results and those of others
in their highly influential books, which educated generations of
computer scientists.
Most of us probably have several of their books on the shelf; I certainly do!
-------------------------------------------------------------------------------
- Nelson H. F. Beebe Tel: +1 801 581 5254 -
- University of Utah FAX: +1 801 581 4148 -
- Department of Mathematics, 110 LCB Internet e-mail: beebe(a)math.utah.edu -
- 155 S 1400 E RM 233 beebe(a)acm.org beebe(a)computer.org -
- Salt Lake City, UT 84112-0090, USA URL: http://www.math.utah.edu/~beebe/ -
-------------------------------------------------------------------------------
I missed the fact that Posix and Linux ed support s/foo/bar/3 (as opposed
to s3/foo/bar); ex does not, unfortunately.
We need a Great Unification of Line Editors.
John Cowan:
We need a Great Unification of Line Editors.
====
A standard for the standard editor?
I thought the nice thing about standards was that there
were so many of them.
Norman Wilson
Toronto ON
I had *.clients.your-server.de crawling mcvoy.com in violation of my
robots.txt. For whatever reason, the tty settings (or something)
made vi not work, I dunno what the deal is, stty -tabs didn't help.
So I had to resort to ed to write and debug the little program below.
It was surprisingly pleasant, it's probably the first time I've used ed
for anything real in at least a decade. My fingers still know it.
+1 for ed. It's how many decades old and still useful?
#!/usr/libexec/bitkeeper/bk tclsh
int
main(void)
{
FILE log = popen("/var/log/apache2/dns.l", "r");
string buf, ip;
string dropped{string};
fconfigure(log, buffering: "line");
while (buf = <log>) {
unless (buf =~ /([^ ]+\.your-server\.de\.) /) continue;
ip = $1;
if (defined(dropped{ip})) continue;
dropped{ip} = "yes";
warn("DROP ${ip}\n");
system("/sbin/iptables -I INPUT -s ${ip} -j DROP");
}
}
Andy Kosela <akosela(a)andykosela.com> wrote:
> On 3/29/21, arnold(a)skeeve.com <arnold(a)skeeve.com> wrote:
> > Andy Kosela <akosela(a)andykosela.com> wrote:
> >
> >> If ed(1) had cursor positioning and full screen capabilities along
> >> with line oriented editing (similar to Atari 8-bit default editor) it
> >> would be perfect. I still love it though and use it pretty often.
> >
> > Try out the 'se' editor, see www.se-editor.org.
>
> Thanks. It is a nice editor, but it actually resembles ex(1) when
> using visual mode. Maybe I am missing something but it appears you
> cannot actually use cursor keys to visually edit lines in the upper
> area of the screen in se -- you can only edit cmd line.
>
> As far as I know there is no editor in the Unix land which gives you
> the ability to work in the ed(1) line oriented mode BUT also allowing
> to freely move cursor keys in all directions. I gave example of the
> Atari editor[1] which does exactly that. I believe to accomplish it
> on Unix one would need to hack ed(1) and add ncurses(3) cursor
> positioning.
>
> --Andy
>
> [1] https://youtu.be/c9o92l5gupI
> the hammer fired to make an impression the ribbon on the paper, which was
> caused the noise people associated with computer printers.
GE outdid the printer with a fantastically fast pneumatic card reader. The make
and break of the suction on each card repeated at aural frequency and so loud
that I hied off to the instrument stockroom to borrow a noise meter. It was 90db
at the operator's position.
ed is the standard editor, they say.
The b command (stands for browse) came from late-1970s
U of T; rob probably brought it to 1127. There were a
handful of other syntactic conveniences, like being
allowed to leave off the final delimeter of an s command,
and declaring that a missing address means 1 before the
comma or semicolon and $ after, so
3,s/fish/&head
works over all lines from 3 to the last, and , standing
alone addresses the whole buffer.
Also the idea that s followed by a digit N means start
with the Nth instance of the pattern:
s3/fish/&head/
affects only the third fish, and
s3/fish/&head/g
every fish after the second.
I have all those tweaks, plus a few others, embedded in
my fingers from the qed produced by the same Toronto
hacks. I contracted it from the copy rob left behind
at Caltech, which means it has been my editor of choice
for 40 years now (with sam as an alternate favourite
since its inception 35 years or so ago). That qed
has a lot of cryptic programming stuff that I have
mostly forgotten because it was never that useful, but
what really hooked me was
a. Multiple buffers, with the ability to move and
copy text between them reasonably smoothly (both with
the m and t commands and with an interpolate-into-input
magic character);
b. The > < | commands, which respectively send the
addressed lines to a shell command (default ,), replace
the addressed lines or append after the single addressed
line the standard output of the shell command (default .),
and replaced addressed lines with what you get by
sending them (default ,) to the shell command, replacing
them with its standard output.
The last operators make qed into a kind of workbench,
both for massaging data and for constructing a list
of commands to send to the shell.
I gather current Linux/BSD eds have > and <, spelled
r ! and w !, but without | it just ain't the same,
rather like the way | revolutionized the shell.
I believe the credit for U of T ed and qed go mainly
to Rob Pike, Tom Duff, Hugh Redelmeier, and the (alas
now late) David Tillbrook. David remained an avid
user of qed, continuing to add stuff to it.
Norman Wilson
Toronto ON
PS: this message, as most of my e-mail, composed by
typing it into qed, editing as needed, then running
>mail tuhs(a)tuhs.org