bug-ed
[Top][All Lists]
Advanced

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

Re: A suggestion to add to gnu ed: command line option to start on line


From: John Cowan
Subject: Re: A suggestion to add to gnu ed: command line option to start on line foo or bar.
Date: Sun, 19 Feb 2023 04:54:45 -0500

I would suggest doing this in an `ex`-compatible way.  That is, the command
line argument +n causes the current line to be n, and the command line
argument +/pattern causes the current line to be the first line matching
the pattern.  Given the file foo.txt containing five lines "one", "two",
"three", "four", "five", then "ed +2 foo.txt" will sest the current line to
2 and "ed +/thr foo.txt" will set the current line to 3.  Patterns are
regular expressions.

On Sun, Feb 19, 2023 at 4:28 AM Matthew Polk <tracekeepper@gmail.com> wrote:

> I like ed. I think it's a cool editor. One thing that in my opinion to
> make it more usable with other programs would be to have implemented,
> is a command line option to have ed automatically start at the
> specified line rather than at the very bottom. I like to (for example)
> use less to view text files as a pager and would like to use ed to
> edit a line, but setting ed as my $EDITOR causes it to always open at
> the very bottom of the file. So I decided to do something about it, by
> contributing to ed for the next release. I'm willing to spend a few
> days to write up a patch because ed is a rather small program and get
> it reviewed for changes. I first would like suggestions on how to
> tackle this. If anyone wishes to offer help, it would be appreciated.
> Ed already has a few extensions not found on BSD (Such as OpenBSD ed)
> or especially historical ed, so it wouldn't at all feel out of place
> to have a feature found in vi or emacs.
>
>


reply via email to

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