[nmh-workers] Unnecessary dependency on vi???

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
77 messages Options
1234
Reply | Threaded
Open this post in threaded view
|

Re: Unnecessary dependency on vi???

Andy Bradford-2
Thus said Ken Hornstein on Sat, 17 Mar 2018 20:25:05 -0400:

> Yeah, I  tried it quickly and  it seems simple enough.  And people who
> have  editor in  their profile  or  use EDITOR/VISUAL  won't notice  a
> change.

Under what conditions will this change? I have neither EDITOR/VISUAL nor
profile  settings for  editor, but  maybe that  won't matter  because my
usage patterns will never invoke prompter?

Right now, when I run comp from the command line, I get a vi editor with
with components in it. Is this where prompter comes in?

Sounds like I might  have to add something to my  profile now after this
change is made to avoid prompter.

Andy
--
TAI64 timestamp: 400000005aae8212



--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: Unnecessary dependency on vi???

David Levine-3
Andy wrote:

> Thus said Ken Hornstein on Sat, 17 Mar 2018 20:25:05 -0400:
>
> > Yeah, I  tried it quickly and  it seems simple enough.  And people who
> > have  editor in  their profile  or  use EDITOR/VISUAL  won't notice  a
> > change.
>
> Under what conditions will this change?

If there is no editor component in the user's profile and the user
does not have either VISUAL or EDITOR set in their environment.

    Editor: prompter
    Defines the editor to be used by the commands comp, dist, forw,
    and repl.  If not set, the value will be taken from the VISUAL and
    EDITOR environment variables.  (profile, default: prompter)

The precendence in order from high to low is:  1) editor
component, 2) VISUAL, 3) EDITOR.

> I have neither EDITOR/VISUAL nor
> profile  settings for  editor, but  maybe that  won't matter  because my
> usage patterns will never invoke prompter?

If you use comp, dist, forw, or repl, it sounds like they will
invoke prompter, via whatnow, instead of vi.

> Right now, when I run comp from the command line, I get a vi editor with
> with components in it. Is this where prompter comes in?

Yes.

> Sounds like I might  have to add something to my  profile now after this
> change is made to avoid prompter.

Yes, it does.  Add this to your profile to preserve your current behavior:
Editor: vi

You can add it before picking up the change, without impacting
current behavior.

David

--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: Unnecessary dependency on vi???

Bakul Shah
>
> Yes, it does.  Add this to your profile to preserve your current behavior:
> Editor: vi
>
> You can add it before picking up the change, without impacting
> current behavior.

There are a number of programs that allow use of an editor.
Commands like chfn, chpass, crontab, sdiff, less/more, various
shells etc.  Setting EDITOR or VISUAL will help there as well.

--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: Unnecessary dependency on vi???

David Levine-3
Bakul wrote:

> > Yes, it does.  Add this to your profile to preserve your current behavior:
> > Editor: vi
> >
> > You can add it before picking up the change, without impacting
> > current behavior.
>
> There are a number of programs that allow use of an editor.
> Commands like chfn, chpass, crontab, sdiff, less/more, various
> shells etc.  Setting EDITOR or VISUAL will help there as well.

Just to be clear:

The quote above about preserving, and not impacting, current behavior
applies to the "Editor: vi" profile addition.  That profile addition
will not affect programs invoked outside of nmh.

David

--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: Unnecessary dependency on vi???

Robert Elz
In reply to this post by David Levine-3
    Date:        Sun, 18 Mar 2018 13:47:24 -0400
    From:        David Levine <[hidden email]>
    Message-ID:  <[hidden email]>


  | The precendence in order from high to low is:  1) editor
  | component, 2) VISUAL, 3) EDITOR.

Actually, just to be precise, before those comes the -editor
switch to the program (comp, repl, etc).

I too have had an "editor" component in $MH_PROFILE
for a very very long time now, and had no idea that the
default editor had been switched away from prompter
(and I am glad to hear it has been switched back) - but
I have continued to use prompter from time to time,
especially with "repl" via the -editor switch (-ed) when
the reply is going to be something very simple, like "OK"
It is much easier & quicker to drive than any real editor
for things like that.

I also suspect that many of you do not recall using MH
back when the only real alternative editors to prompter
were not vi or emacs (or semi-clones to one of those)
but ed or Rand's 'e' and a few others similar (em from
QMC for example) - I don't think ex is quite as old as
MH (and vi certainly is not, not even as an ex cmd.)

kre


--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: Unnecessary dependency on vi???

Bakul Shah
On Mon, 19 Mar 2018 04:06:30 +0700 Robert Elz <[hidden email]> wrote:
Robert Elz writes:

>     Date:        Sun, 18 Mar 2018 13:47:24 -0400
>     From:        David Levine <[hidden email]>
>     Message-ID:  <[hidden email]>
>
>
>   | The precendence in order from high to low is:  1) editor
>   | component, 2) VISUAL, 3) EDITOR.
>
> Actually, just to be precise, before those comes the -editor
> switch to the program (comp, repl, etc).
>
> I too have had an "editor" component in $MH_PROFILE
> for a very very long time now, and had no idea that the
> default editor had been switched away from prompter
> (and I am glad to hear it has been switched back) - but
> I have continued to use prompter from time to time,
> especially with "repl" via the -editor switch (-ed) when
> the reply is going to be something very simple, like "OK"
> It is much easier & quicker to drive than any real editor
> for things like that.
>
> I also suspect that many of you do not recall using MH
> back when the only real alternative editors to prompter
> were not vi or emacs (or semi-clones to one of those)
> but ed or Rand's 'e' and a few others similar (em from
> QMC for example) - I don't think ex is quite as old as
> MH (and vi certainly is not, not even as an ex cmd.)

Bill Joy wrote vi in 1976 while at UCB. I believe MH came
later. Initially I used vi and Mail but later switched to e
and mh -- may be because @ Fortune we now had Dave Yost and
Rick Kiessig they'd both worked at Rand and on at least the
Rand Editor.  From what I recollect, more people used Mail
than MH and I believe the $EDITOR/$VISUAL convention for
calling an editor was well established. But it is possible
MH picked this up much later.

--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: Unnecessary dependency on vi???

Ralph Corderoy
Hi Bakul,

> Initially I used vi and Mail but later switched to e and mh -- may be
> because @ Fortune we now had Dave Yost and Rick Kiessig they'd both
> worked at Rand and on at least the Rand Editor.

https://en.wikipedia.org/wiki/E_Text_Editor isn't RAND's text editor,
unfortunately, though I did find
https://www.rand.org/pubs/notes/N2239-1.html that's a PDF on `The RAND
Editor e: Version 19'.  NED has a couple of pages on there too, e.g.
https://www.rand.org/pubs/reports/R2000.html

It's nice to see an outfit that has pride in keeping its old
publications available, unlike what remains of Bell Labs.

--
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy

--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: Unnecessary dependency on vi???

Ken Hornstein-2
In reply to this post by Ken Hornstein-2
>> Yeah, I  tried it quickly and  it seems simple enough.  And people who
>> have  editor in  their profile  or  use EDITOR/VISUAL  won't notice  a
>> change.
>
>Under what conditions will this change? I have neither EDITOR/VISUAL nor
>profile  settings for  editor, but  maybe that  won't matter  because my
>usage patterns will never invoke prompter?

If you're a long-time MH user, I admit that I am surprised you never set
anything in your profile; it seems like the default was prompter for a
long time (although, like I said earlier, that depends on your specific
site configuration; if people used the default configuration shipped in
MH 6.8 you ended up with vi).  I know I've been using Editor: vi in
my .mh_profile for approximately forever.

EDITOR/VISUAL support is a recent nmh thing.

--Ken

--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: Unnecessary dependency on vi???

Andy Bradford-2
Thus said Ken Hornstein on Sun, 18 Mar 2018 19:49:03 -0400:

> If you're a long-time  MH user, I admit that I  am surprised you never
> set anything in  your profile; it seems like the  default was prompter
> for a long  time (although, like I said earlier,  that depends on your
> specific site configuration;

I've been  using (N)MH since  2,000 and I think  this is the  first time
I've run into  prompter; though I must  admit that I used  Exmh a couple
years before I began investigating the command line tools, but as far as
I can remember,  I've never had to interface with  prompter. As you say,
perhaps this was  due to specific configuration of which  I was unaware,
but I've usually just used whatever the OS vendor shipped as defaults.

Andy
--
TAI64 timestamp: 400000005aaf0524



--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: Unnecessary dependency on vi???

Robert Elz
In reply to this post by Bakul Shah
    Date:        Sun, 18 Mar 2018 15:39:50 -0700
    From:        Bakul Shah <[hidden email]>
    Message-ID:  <[hidden email]>

  | Bill Joy wrote vi in 1976 while at UCB.

I know, but it wasn't on the 1BSD tape (ex was I think), the vi
command in ex (and the vi command) were on the 2BSD tape
(about 78 I think.)   Mail was on the 1BSD tape I believe
(that is, I thnk I remember...)

  | I believe MH came later.

The Rand distribution, with MH and e, was at a similar time
to the 1BSD tape, arund 76-77.   Which was first I have no
idea, but development on them would have been happening
more or less in parallel.

  |  From what I recollect, more people used Mail
  | than MH and I believe the $EDITOR/$VISUAL convention for
  | calling an editor was well established.

EDITOR and VISUAL are environment variables - therefore did
not exist before 7th edition (or 32V) - that is, about 79.   All of
MH, e, ex, vi, and Mail existed long before those could possibly
have been in use.    Exactly when EDITOR first appeared I am
not sure (it was not one of the env vars used by anthing in the
7th edition - the editor there was just ed - no need to be able to
specify an alternative.)   VISUAL as an alternative to EDITOR
came much later.

kre


--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: Unnecessary dependency on vi???

Ralph Corderoy
In reply to this post by Andy Bradford-2
> I've been using (N)MH since 2,000

Quick lads!  A new user!  Don't let him get away!

--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: Unnecessary dependency on vi???

Ken Hornstein-2
In reply to this post by Robert Elz
>EDITOR and VISUAL are environment variables - therefore did
>not exist before 7th edition (or 32V) - that is, about 79.   All of
>MH, e, ex, vi, and Mail existed long before those could possibly
>have been in use.    Exactly when EDITOR first appeared I am
>not sure (it was not one of the env vars used by anthing in the
>7th edition - the editor there was just ed - no need to be able to
>specify an alternative.)   VISUAL as an alternative to EDITOR
>came much later.

So since you were there ... I never did understand the point (or the
distinction) between VISUAL and EDITOR.  More specifically, I never
understood when you were supposed to use one versus the other.

--Ken

--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: Unnecessary dependency on vi???

Paul Fox-3
ken wrote:
 > So since you were there ... I never did understand the point (or the
 > distinction) between VISUAL and EDITOR.  More specifically, I never
 > understood when you were supposed to use one versus the other.

i can answer that one.

in the bad old days, if you were working on a slow dialup (300 or
1200 baud), or, actually, a printing terminal at any speed, you'd
probably want to invoke ed or ex.  if you were working on a
"high-speed" 9600 baud terminal, you'd likely want vi or emacs etc.
so a program like mail would offer two escapes (~e vs.  ~v) to let yo
invoke either.

paul
=----------------------
paul fox, [hidden email] (arlington, ma, where it's 33.8 degrees)


--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: Unnecessary dependency on vi???

Ken Hornstein-2
> > So since you were there ... I never did understand the point (or the
> > distinction) between VISUAL and EDITOR.  More specifically, I never
> > understood when you were supposed to use one versus the other.
>
>i can answer that one.
>
>in the bad old days, if you were working on a slow dialup (300 or
>1200 baud), or, actually, a printing terminal at any speed, you'd
>probably want to invoke ed or ex.  if you were working on a
>"high-speed" 9600 baud terminal, you'd likely want vi or emacs etc.
>so a program like mail would offer two escapes (~e vs.  ~v) to let yo
>invoke either.

So ... I guess programs would look at the terminal and if your speed was
9600 baud or greater, you'd use VISUAL, and if it was slower you'd use
EDITOR?  I could believe that (although from memory I don't recall vi
being that bad at 2400 baud, but it was a while ago!).

--Ken

--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: Unnecessary dependency on vi???

Paul Fox-3
ken wrote:
 > > > So since you were there ... I never did understand the point (or the
 > > > distinction) between VISUAL and EDITOR.  More specifically, I never
 > > > understood when you were supposed to use one versus the other.
 > >
 > >i can answer that one.
 > >
 > >in the bad old days, if you were working on a slow dialup (300 or
 > >1200 baud), or, actually, a printing terminal at any speed, you'd
 > >probably want to invoke ed or ex.  if you were working on a
 > >"high-speed" 9600 baud terminal, you'd likely want vi or emacs etc.
 > >so a program like mail would offer two escapes (~e vs.  ~v) to let yo
 > >invoke either.
 >
 > So ... I guess programs would look at the terminal and if your speed was
 > 9600 baud or greater, you'd use VISUAL, and if it was slower you'd use
 > EDITOR?  I could believe that (although from memory I don't recall vi
 > being that bad at 2400 baud, but it was a while ago!).

I suppose that might have been done, but I don't recall programs
making the choice by themselves.  It was more along the lines of the
mail(1) feature, where the user could decide on the fly to choose
"terse line oriented" (via EDITOR) or "feature-rich screen oriented"
(via VISUAL).  I don't recall any other examples of programs offering
that sort of choice at the moment.  (Nor will I probably for the
foreseeable future -- it was a while ago.  :-)

You're right about vi not being too bad at slower rates, and there was
a huge amount of optimization in the code to make it all feasible.  As
example, the ADM-3A (on which Bill Joy developed vi) lacked a 'delete
line' screen manipulation command.  So when vi deleted a line, it
would do a "clear to EOL", and then put insert an '@' sign at the
front of the resulting blank line, to indicate to the user that the
line didn't really exist in the edit buffer.  This saved adjusting the
rest of the lines.  If you deleted a bunch of lines, you'd end up with
a bunch of empty space on the screen.  Refreshes were expensive, so
there were two different "refresh the screen" commands:  ^L, which
would do a full redraw, and ^R, which would only redraw from the first
deleted line down, thereby saving the time of redrawing anything from
that point up.

(I still remember my sense of wonder when I saw an ADM-3A running vi
at Bell Labs, at a whopping 9600 baud, when I arrived there in 1980.
I knew about tty-like terminals, and I knew about graphics, but it had
never occurred to me that you could do that kind of editing with a
text-based terminal.  Hey, I was young...)

paul
=----------------------
paul fox, [hidden email] (arlington, ma, where it's 32.5 degrees)


--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: Unnecessary dependency on vi???

Robert Elz
In reply to this post by Ken Hornstein-2
    Date:        Mon, 19 Mar 2018 15:29:30 -0400
    From:        Ken Hornstein <[hidden email]>
    Message-ID:  <[hidden email]>

  | So since you were there ... I never did understand the point (or the
  | distinction) between VISUAL and EDITOR.

Paul's explanation seems right to me - commands like Mail had two "run an
editor" commands, so the user could choose what kind of editor they wanted
to run (and initially, so different users could pick the editing style of their
choice).    Once env vars existed, and could be put to use to allow the user
to select which editor to run, I guess it just made sense to use a different
one for each of the commands (editing styles) that existed.   But, for me, this
is guesswork, I was never part of any discussions (if there were any) on this.

kre


--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: Unnecessary dependency on vi???

Jon Fairbairn
In reply to this post by Ken Hornstein-2
Ken Hornstein <[hidden email]> writes:
> So ... I guess programs would look at the terminal and if your speed was
> 9600 baud or greater, you'd use VISUAL, and if it was slower you'd use
> EDITOR?  I could believe that (although from memory I don't recall vi
> being that bad at 2400 baud, but it was a while ago!).

Speed wasn’t the only thing, remember. I certainly used a
hardcopy terminal in 1979, probably later (not connected to a
Unix system, but still), and neither vi nor emacs would have
been a good choice :-)


--
Jón Fairbairn                                 [hidden email]


--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: Unnecessary dependency on vi???

Ralph Corderoy
In reply to this post by Ken Hornstein-2
Hi Ken,

> > so a program like mail would offer two escapes (~e vs.  ~v) to let
> > yo invoke either.
>
> So ... I guess programs would look at the terminal and if your speed
> was 9600 baud or greater, you'd use VISUAL, and if it was slower you'd
> use EDITOR?

No, AFAIK it was always the user's choice.  mail(1) had the `~e' escape
and then added a `~v' one, with VISUAL and EDITOR environment variables
echoing the cpp(1) macro names of the default values.  Kurt Shoens,
[hidden email], is down as the author in
BSD-1-253-gc145e9e0ab5 of
https://github.com/dspinellis/unix-history-repo.

For evermore, programs that only offer one means of invoking an editor
have had to checking first $VISUAL, falling back to $EDITOR.  :-)

That reminds me, whatnow(1) needs a `visual'.

--
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy

--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: Unnecessary dependency on vi???

Steffen Nurpmeso
Ralph Corderoy <[hidden email]> wrote:
 |>> so a program like mail would offer two escapes (~e vs.  ~v) to let
 |>> yo invoke either.
 |>
 |> So ... I guess programs would look at the terminal and if your speed
 |> was 9600 baud or greater, you'd use VISUAL, and if it was slower you'd
 |> use EDITOR?
 |
 |No, AFAIK it was always the user's choice.  mail(1) had the `~e' escape
 |and then added a `~v' one, with VISUAL and EDITOR environment variables
 |echoing the cpp(1) macro names of the default values.  Kurt Shoens,
 |[hidden email], is down as the author in
 |BSD-1-253-gc145e9e0ab5 of
 |https://github.com/dspinellis/unix-history-repo.

BSD Mail had both of ~v and ~e from the very start.  I know of no
known released file which acted otherwise.

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)

--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
Reply | Threaded
Open this post in threaded view
|

Re: Unnecessary dependency on vi???

Robert Elz
    Date:        Tue, 20 Mar 2018 15:43:37 +0100
    From:        Steffen Nurpmeso <[hidden email]>
    Message-ID:  <20180320144337.zM2RO%[hidden email]>

  | BSD Mail had both of ~v and ~e from the very start.  I know of no
  | known released file which acted otherwise.

Including in the first BSD distribution tape (1BSD) before vi existed (also
before csh existed, but that's unrelated...) ??

This also predates the use of SCCS (or any other revision control system)
at UCB.

kre


--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers
1234