[comp.sys.next] neat feature in "more"

glenn@heaven.woodside.ca.us (Glenn Reid) (02/26/91)

Today I was doing six things at once and forgot that I was reading
a man page in one of my terminal windows (it had the "more--30%--"
prompt at the bottom of the screen).  So I started typing some
command into the Terminal window, and naturally all of the letters
were interpreted as commands for more(1), and it sort of went nuts.

All of a sudden an Edit window popped up with the man page in it!
Some more(1) command had opened up this window....

After a little experimentation and hitting "?" for documentation,
I found out that if you hit 'o' while you're in more(1), the file
that you're currently viewing will be opened in Edit.  Pretty neat.

Just thought some of you might want to know about this.

-- 
 Glenn Reid				RightBrain Software
 glenn@heaven.woodside.ca.us		NeXT/PostScript developers
 ..{adobe,next}!heaven!glenn		415-851-1785 (fax 851-1470)

aHumanBeing@earth.planet.universe (02/26/91)

In article <435@heaven.woodside.ca.us> glenn@heaven.woodside.ca.us (Glenn Reid) writes:
   I found out that if you hit 'o' while you're in more(1), the file
   that you're currently viewing will be opened in Edit.  Pretty neat.
   Just thought some of you might want to know about this.

great. now people can wipe out their man pages. real helpful. thanks.

auvhess@auvc6.tamu.edu (David K. Hess) (02/27/91)

In article <AHUMANBEING.91Feb26082659@earth.planet.universe>,
aHumanBeing@earth.planet.universe writes:
|> In article <435@heaven.woodside.ca.us> glenn@heaven.woodside.ca.us
(Glenn Reid) writes:
|>    I found out that if you hit 'o' while you're in more(1), the file
|>    that you're currently viewing will be opened in Edit.  Pretty neat.
|>    Just thought some of you might want to know about this.
|> 
|> great. now people can wipe out their man pages. real helpful. thanks.

Give it a break. man pages are usually owned by root and nobody else has
write privileges unless you are foolish enough to login as root all the
time.

This makes a good way to grab a snippet of a man page and reformat and print
for your own use.

Investigate a little more before you decide to slam somebody's tidbit.

Dave Hess
Graduate Student
Texas A&M University
auvhess@auvsun1.tamu.edu

lacsap@plethora.media.mit.edu (Pascal Chesnais) (02/27/91)

In article <435@heaven.woodside.ca.us> glenn@heaven.woodside.ca.us (Glenn Reid)  
writes:
> 
> After a little experimentation and hitting "?" for documentation,
> I found out that if you hit 'o' while you're in more(1), the file
> that you're currently viewing will be opened in Edit.  Pretty neat.


Note this does not work if you have used simsong's EL2 stuff to
open docs...  I won't ask_next to figure out why, and I don't have
sources to find out for myself.

error generated: openfile: Can't connect to Edit

Pascal Chesnais, Research Specialist, Electronic Publishing Group
Media Laboratory, E15-351, 20 Ames Street, Cambridge, Ma, 02139 (617) 253-0311
email: lacsap@plethora.media.mit.edu (NeXT)

declan@remus.rutgers.edu (Declan McCullagh/LZ) (02/27/91)

In article <12712@helios.TAMU.EDU>, auvhess@auvc6.tamu.edu (David K. Hess) writes:

> Give it a break. man pages are usually owned by root and nobody else has
> write privileges unless you are foolish enough to login as root all the
> time.

In the default 2.0 distribution, man pages are writable by root only,
but the preformatted cat pages are writeable by all.  If I, as a
normal user, wanted to modify the cat pages (by opening them with
more's 'o' command, or with emacs or whatever), I could.

-Declan

glenn@heaven.woodside.ca.us (Glenn Reid) (02/27/91)

aHumanBeing@earth.planet.universe writes
> In article <435@heaven.woodside.ca.us> glenn@heaven.woodside.ca.us writes:
>>    I found out that if you hit 'o' while you're in more(1), the file
>>    that you're currently viewing will be opened in Edit.  Pretty neat.
>>    Just thought some of you might want to know about this.
> 
> great. now people can wipe out their man pages. real helpful. thanks.

I appreciate your brevity in posting, but not so much your approach.  I  
especially dislike sarcasm when it stems from misinformation or laziness in  
research.

You can't wipe out your man pages through this helpful feature for several  
reasons:

    1.  The files are not writable by normal users.  If you log in
	routinely as root and wipe out anything, I don't feel too sorry
	for you.
    2.  The pages that are displayed by "man" are the output of the nroff
	filters that format the real man page data for the screen.  If
	these files are deleted, it's no big deal; they are automatically
	re-created if you ask for the man page again.
    3.  Even though the files are opened in Edit, you have to acutally make
	substantive changes and Save the documents in order for the man
	pages to be "wiped out".  Most people would not do this on purpose,
	and it doesn't represent a very real problem.  In the words of a
	famous computer scientist, "all power tools can kill."

You should also delete your news-posting software, since it has a forged  
posting address (earth.planet.universe).  I suppose it's easier to flame people  
when no one can see who you are (cs.utexas.edu!helios!aHumanBeing, indeed).

Here's who I am:
--
 Glenn Reid				RightBrain Software
 glenn@heaven.woodside.ca.us		NeXT/PostScript developers
 ..{adobe,next}!heaven!glenn		415-851-1785 (fax 851-1470)

scott@erick.gac.edu (Scott Hess) (02/27/91)

In article <5376@media-lab.MEDIA.MIT.EDU> lacsap@plethora.media.mit.edu (Pascal Chesnais) writes:
   In article <435@heaven.woodside.ca.us> glenn@heaven.woodside.ca.us (Glenn Reid)  
   writes:
   > 
   > After a little experimentation and hitting "?" for documentation,
   > I found out that if you hit 'o' while you're in more(1), the file
   > that you're currently viewing will be opened in Edit.  Pretty neat.


   Note this does not work if you have used simsong's EL2 stuff to
   open docs...  I won't ask_next to figure out why, and I don't have
   sources to find out for myself.

   error generated: openfile: Can't connect to Edit

This is for the same reason you probably can't do it by dbl-clicking on
a source file in InterfaceBuilder (well, at least you couldn't in 1.0).
For some reason or another, NeXT chose to code it as an openfile(1) call
rather than an open(1) call.  Why?  I don't know.  But, this means that
any non-Edit editor you come up with won't interact all that well with
InterfaceBuilder, more, and presumably other programs (though I've
not run across any, yet).

One fix you _might_ attempt would be to replace openfile with some other
program (like an emacs-client).  I'm not sure if it is good enough
to place an openfile command in your path before /usr/bin, or if
you'd have to physically replace openfile (probably wouldn't be the
the best idea unless you are the only user :-).

Later,
--
scott hess                      scott@gac.edu
Independent NeXT Developer	GAC Undergrad
<I still speak for nobody>
"Tried anarchy, once.  Found it had too many constraints . . ."
"Buy `Sweat 'n wit '2 Live Crew'`, a new weight loss program by
Richard Simmons . . ."

dan@gacvx2.gac.edu (02/28/91)

In article <SCOTT.91Feb27082023@erick.gac.edu>, scott@erick.gac.edu (Scott Hess) writes:
> In article <5376@media-lab.MEDIA.MIT.EDU> lacsap@plethora.media.mit.edu (Pascal Chesnais) writes:
>    In article <435@heaven.woodside.ca.us> glenn@heaven.woodside.ca.us (Glenn Reid)  
>    writes:
>    > 
>    > After a little experimentation and hitting "?" for documentation,
>    > I found out that if you hit 'o' while you're in more(1), the file
>    > that you're currently viewing will be opened in Edit.  Pretty neat.
> 
> 
>    Note this does not work if you have used simsong's EL2 stuff to
>    open docs...  I won't ask_next to figure out why, and I don't have
>    sources to find out for myself.
> 
>    error generated: openfile: Can't connect to Edit
> 
> This is for the same reason you probably can't do it by dbl-clicking on
> a source file in InterfaceBuilder (well, at least you couldn't in 1.0).
> For some reason or another, NeXT chose to code it as an openfile(1) call
> rather than an open(1) call.  Why?  I don't know.  But, this means that
> any non-Edit editor you come up with won't interact all that well with
> InterfaceBuilder, more, and presumably other programs (though I've
> not run across any, yet).
> 
> One fix you _might_ attempt would be to replace openfile with some other
> program (like an emacs-client).  I'm not sure if it is good enough
> to place an openfile command in your path before /usr/bin, or if
> you'd have to physically replace openfile (probably wouldn't be the
> the best idea unless you are the only user :-).
> 
> Later,
> --
> scott hess                      scott@gac.edu
> Independent NeXT Developer	GAC Undergrad
> <I still speak for nobody>
> "Tried anarchy, once.  Found it had too many constraints . . ."
> "Buy `Sweat 'n wit '2 Live Crew'`, a new weight loss program by
> Richard Simmons . . ."

I don't have "EL2" installed and I still get "openfile: Can't connect to Edit".
Any ideas.

-- 
Dan Boehlke                    Internet:  dan@gac.edu
Campus Network Manager         BITNET:    dan@gacvax1.bitnet
Gustavus Adolphus College
St. Peter, MN 56082 USA        Phone:     (507)933-7596

glenn@heaven.woodside.ca.us (Glenn Reid) (03/01/91)

dan@gacvx2.gac.edu writes
> I don't have "EL2" installed and I still get "openfile: Can't connect to  
Edit".
> Any ideas.

If you are running "more" from a userid that is different from the one who owns  
the WindowServer (and hence Edit), you can't connect to Edit.  In particular,  
if you did an "su" to another userid (or root), it won't work.

--
 Glenn Reid				RightBrain Software
 glenn@heaven.woodside.ca.us		NeXT/PostScript developers
 ..{adobe,next}!heaven!glenn		415-851-1785 (fax 851-1470)

gessel@ilium.cs.swarthmore.edu (Daniel Mark Gessel) (03/05/91)

>I don't have "EL2" installed and I still get 
>"openfile: Can't connect to Edit". Any ideas.

Edit has to be running for openfile to work. 

Dan
--
Daniel Mark Gessel
Internet: gessel@cs.swarthmore.edu
I do not speak (nor type) representing Swarthmore College.