[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] ed with perl-compatible regular expressions

From: John Cowan
Subject: Re: [PATCH] ed with perl-compatible regular expressions
Date: Tue, 27 Jul 2021 14:25:51 -0400

On Tue, Jul 27, 2021 at 12:43 PM Bob Proulx <bob@proulx.com> wrote:

> Not that long ago, well it was pre-pandemic times when we used to
> meet-up in person, I used ed to rescue a friend's Ubuntu laptop that
> he had messed up while at the meet-up!  He had no functional editor
> that we could find other than ed.  I don't know why but he had the
> packaged ed installed.  I am guessing some DE dependency pulled in a
> dependency and on down the line and ed was installed.  I was able to
> use ed to rescue his system!  No amount of local custom building could
> have worked in that situation.

No. But I am talking about a run-time option, not a config-time option
(although a config-time option to disable --pcre would make sense for
low-disk or low-memory configurations).

> Expanding ed to include creeping features is an insidious path.  Where
> does it stop?

Well, I don't know: it's a matter of taste.  Research Unix never had the -p
option or P command, and neither did any BSD version up to 4.3, so someone
had to add it so that it got into Posix and GNU ed.  Was that a creeping

On the other hand these versions did have the x command and option (changed
to X in 8th Edition and later) to decrypt files on input and encrypt them
on output.  That didn't make it into Posix, but it would make a lot of
sense when editing a file on NFS or other shared filesystems: it seems like
it's a feature that crept away.

If Emacs or Vim are the obvious goals then why not
> simply use Emacs/Vim now?  Why try to mutate ed to be down that path
> instead of simply using the editor that supports these features in the
> first place?  And also if so then why start with ed instead of editors
> like nano that are already further along the path to that goal?
> > It's unlikely you'd type such an extension by mistake, unlike (say) ed
> -P.
> >
> > I already use alias ed=ed -p '* ' because I like prompts, but if I'm
> > running an ed script, I use \ed <foo.ed.
> This is not really the same thing.  Because these are features that
> are portably available in every version of ed.
> Bob

reply via email to

[Prev in Thread] Current Thread [Next in Thread]