The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Bakul Shah <bakul@bitblocks.com>
To: Doug McIlroy <doug@cs.dartmouth.edu>
Cc: tuhs@tuhs.org
Subject: Re: [TUHS] block operations in editors, was My EuroBSDcon talk
Date: Mon, 16 Sep 2019 18:25:39 -0700	[thread overview]
Message-ID: <20190917012546.392E51570CE9@mail.bitblocks.com> (raw)
In-Reply-To: Your message of "Mon, 16 Sep 2019 20:20:32 -0400." <201909170020.x8H0KWC6037690@tahoe.cs.Dartmouth.EDU>

On Mon, 16 Sep 2019 20:20:32 -0400 Doug McIlroy <doug@cs.dartmouth.edu> wrote:
Doug McIlroy writes:
> > The "block copy in an editor" thing is something which has intrigued
> > me for years. poor old ed/ex/vi just couldn't do it, and for the life
> > of me, I could not understand why this was "deprecated" by the people
> > writing that family of editors.
>
> One might trace it to the founding tenet that a file is a stream of bytes,
> reinforced by the absence of multidemensional arrays in C. But it goes
> deeper than that.
>
> Ed imposes a structure, making a (finite) file into an array, aka list,
> of lines. It's easy to define block moves and copies in a list. But
> what are the semantics of a block move, wherein one treats the list
> as a ragged-right 2D array? What gets pushed aside? In what direction?
> How does a block move into column that not all destination rows
> reach? How do you cope when the bottom gets ragged? How about the
> top? Can one move blocks of tab-separated fields?
>
> I think everyone has rued the lack of block operations at one time
> or another. But implementing them in any degree of generality is a
> stumbling block. What should the semantics be?

The Rand editor e handled all this reasonably well.

A file was treated as a virtual quarter plane, with 0,0 as
the start of the file (you could move a cursor anywhere
including a non-existant line or column.  Extra blanks or
lines were added only if you actually typed something there).

In the command line (like vi's exmode) for many commands you
can specify an area of operation which can be n lines, n
paragraphs or a rectangle, starting at the cursor position. Or
you can select a rectangular area with the "mark" command. If
you move the cursor straight down, N lines would be chosen.
To pick nx1 rectangle, you move cursor right one place after
marking.

open would open up a blank area,  pushing text left as
necessary.  close would close up an area, pushing text right
if necessary. erase would blank out an area (erase text but
leave text outside alone). run command replaced the contents
with the output of a shell command. feed was like run except
it kept the original and inserted new data at the cursor.

Tabs were not separators but stood for specific columns.  By
default every 8 columns but you could change them to whatever.
picking a rectangle handled them appropriately.  IIRC.  You
stored non standard tab positions in a separate file.

  parent reply	other threads:[~2019-09-17  1:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-17  0:20 Doug McIlroy
2019-09-17  0:42 ` G. Branden Robinson
2019-09-17  2:02   ` George Michaelson
2019-09-17 11:01   ` Thomas Paulsen
2019-09-17  1:25 ` Bakul Shah [this message]
2019-09-17 11:34 Thomas Paulsen
2019-09-17 15:36 Noel Chiappa
2019-09-17 17:31 Doug McIlroy
2019-09-18  4:47 ` Steve Johnson
2019-09-18  4:52   ` Jon Steinhart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190917012546.392E51570CE9@mail.bitblocks.com \
    --to=bakul@bitblocks.com \
    --cc=doug@cs.dartmouth.edu \
    --cc=tuhs@tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).