bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: GNU ex (an enhanced version of GNU ed)


From: John Cowan
Subject: Re: GNU ex (an enhanced version of GNU ed)
Date: Sun, 24 Apr 2005 22:31:25 -0400
User-agent: Mutt/1.4.1i

Karl Berry scripsit:

> I don't believe there is any GNU ex; at least, I don't see one listed in
> the usual places.  If that's so, I don't see any particular barrier to
> making it a GNU package when it is ready.  Please email
> address@hidden when you have something you'd like to be looked
> at.

Excellent.

> Several patches have come in regarding GNU ed from time to time.  Some
> might be relevant to ex, I'm not sure.  I can try to dig them up.  I
> expect that Red Hat, Debian, etc., have made tons of changes as well.

I'll be happy to incorporate any patches.

> I am not sure how to reconcile the "ed" mode of your putative GNU ex and
> the current GNU ed, but I guess we can cross that bridge when we come to it.

If my program is run in ed-mode (that is, no -e switch given and not
installed as 'ex'), then it behaves exactly like ed, with these three
exceptions:

1) Attempting to use a lower-case letter as a regex delimiter produces
unpredictable results.  (That is because all commands are allowed to be
given in full form, as in historic 'ex'; this could be undone, as it's
a technical POSIX violation.)

2) A space rather than a newline separates the "?" from a following
error message when in verbose-error mode.  (This is meant to improve
readability, and could be undone; it's a POSIX violation.)

3) Various extended commands Just Work, like "q!" (the ex version of
"Q"), or the filter form of "!".

My view is that these changes are sufficiently small that my program
can be accepted as both GNU 'ed' and GNU 'ex'.

So what does ed-mode vs. ex-mode achieve?  Well, the command "x" has
different effects in GNU 'ed' and in historic 'ex':  the former uses it
for "put the yank buffer" (an extension to historic and POSIX 'ed's),
the latter for "write if modified, then quit".  So in my program "x" means
put in ed-mode and write-if-mod-quit in ex-mode.  However, "pu[t]" always
means put, regardless of mode, and "X" always means write-if-mod-quit,
regardless of mode.  These come under exception 3 above.

> Speaking for myself, I use ed all the time (to edit crontabs in an ssh
> buffer under Emacs), and have come across a few annoyances that have
> never been fixed.  I would be very happy to see an actively-maintained
> ed or ex!

Tell me what you would like changed.

> (As for visual mode, you could probably just fork $VISUAL :)

I thought about that, but it doesn't quite have the right semantics.
Currently, if you try to run my program as 'vi', or if you give it
the undocumented -v switch, it prints:

        This is GNU ed version 0.3.
        If you want nvi, vim, elvis, or vile,
        you know where to find them.

-- 
John Cowan                                address@hidden
At times of peril or dubitation,          http://www.ccil.org/~cowan
Perform swift circular ambulation,        http://www.reutershealth.com
With loud and high-pitched ululation.




reply via email to

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