[comp.sys.next] Big pain

farber@linc.cis.upenn.edu (David Farber) (07/20/89)

there has got to be a way to print a cut piece of a file with out opening
the Editor , pasting it and then Print it (I hope there is).

Some one tell me the secret. Clearly there has to be one.

Dave

David Farber; Prof. of CIS and EE, U of Penn, Philadelphia, PA 19104-6389 Tele:
215-898-9508(off); 215-274-8292 (home); FAX: 215-274-8192;  Cellular:  302-740-
1198 "The fundamental principle of science, the definition almost, is this: the
sole test of the validity of any idea is experiment." -- R. P. Feynman

dorner@pequod.cso.uiuc.edu (Steve Dorner) (07/20/89)

In article <13066@netnews.upenn.edu> farber@linc.cis.upenn.edu (David Farber) writes:
>
>
>there has got to be a way to print a cut piece of a file with out opening
>the Editor , pasting it and then Print it (I hope there is).

I *think* you are supposed to be able to use the "User" menu for this;
see the Edit documentation in the DL.  I've never been able to get it
to work, but I haven't tried hard.

On a related issue; it sure would be nice if there were a unix device
called "scrap", that handled the scrap.  Then, I could say:

% cat foo bar >/dev/scrap

or

% enscript </dev/scrap

Failing that, it would be ok if there were unix commands called cut, copy,
paste, and clear, with the following behaviors:

cut - like cat, only it would write into the scrap, not stdout
copy - like cat, only it would write to BOTH the scrap and stdout
paste - would produce the contents of the scrap on stdout
clear - empty the scrap

I think the utility of these things is obvious.  I don't know about how
easy or difficult they would be to write; though I suspect they wouldn't
be tough.  Unfortunately, I don't have time to try right at the moment.
-- 
Steve Dorner, U of Illinois Computing Services Office
Internet: s-dorner@uiuc.edu  UUCP: {convex,uunet}!uiucuxc!dorner
IfUMust:  (217) 244-1765

dz@lime.ucsb.edu (Daniel James Zerkle) (07/20/89)

>On a related issue; it sure would be nice if there were a unix device
>called "scrap", that handled the scrap.  Then, I could say:
>
>% cat foo bar >/dev/scrap
>
>or
>
>% enscript </dev/scrap
>
>Failing that, it would be ok if there were unix commands called cut, copy,
>paste, and clear, with the following behaviors:
>
>cut - like cat, only it would write into the scrap, not stdout
>copy - like cat, only it would write to BOTH the scrap and stdout
>paste - would produce the contents of the scrap on stdout
>clear - empty the scrap
>
This is trivial:

Cut:    prgname > /tmp/scrap (replace scrap)
        prgname >> /tmp/scrap (append to scrap)
Copy:   prgname | tee /tmp/scrap (replace scrap)
        prgname | tee -i /tmp/scrap (append to scrap)
Paste:  prgname < /tmp/scrap  OR  cat /tmp/scrap | whatever
Clear:  rm /tmp/scrap  (remove scrap)
        cp /dev/null /tmp/scrap  (empty scrap)

With the C shell (or some equivalent), it should be no big deal
to set up aliases called cut, copy, paste, and clear to do this.
If you really want to get fancy, set up this in your .login:

set scrap=/tmp/scrap$$

and refer to $scrap in your aliases.  This way, each user will have
a unique scrap file ($$ to the C-Shell means its own process id.)
It would also be a good idea for the .logout file to remove your
scrap, so there wouldn't be garbage cluttering up the /tmp file after
a few people have been in and out.

Have fun!

dorner@pequod.cso.uiuc.edu (Steve Dorner) (07/21/89)

In article <2098@hub.UUCP> dz@cornu.ucsb.edu (Daniel James Zerkle) writes:
>>cut - like cat, only it would write into the scrap, not stdout
>>...
>This is trivial:
>
>Cut:    prgname > /tmp/scrap (replace scrap)
>...

The obvious problem with this is that /tmp/scrap means NOTHING to
Edit, WriteNow, the Digital Library, or anything else that uses
Cut, Copy, and Paste from the AppKit.

I need to be able to paste into <generic unix command> something I
have just copied from <whiz-bang NeXT application>, and vice-versa.

Try unpacking a shar archive that someone has mailed you sometime.
You have to copy it from Mail, paste it into Edit, save it, close it, then
run sh on it from the Shell, and delete the temporary Edit file.
It would be oh-so-nice to be able to copy it from Mail, and say
"paste | sh" or "sh </dev/scrap".
-- 
Steve Dorner, U of Illinois Computing Services Office
Internet: s-dorner@uiuc.edu  UUCP: {convex,uunet}!uiucuxc!dorner
IfUMust:  (217) 244-1765

bruce@heather.pooh.com (Bruce Robertson) (07/24/89)

In article <1515@garcon.cso.uiuc.edu> dorner@pequod.cso.uiuc.edu (Steve Dorner) writes:

   Try unpacking a shar archive that someone has mailed you sometime.
   You have to copy it from Mail, paste it into Edit, save it, close it, then
   run sh on it from the Shell, and delete the temporary Edit file.
   It would be oh-so-nice to be able to copy it from Mail, and say
   "paste | sh" or "sh </dev/scrap".

Heck, I do this all the time from within GNU Emacs.  I thought NeXT
was supposed to have the latest word in user interfaces!
-- 
	Bruce Robertson
	Hundred Acre Software, Reno, NV
	Domain: bruce@pooh.com
	UUCP:   ...!uunet!tahoe.unr.edu!heather!bruce

gerrit@nova.cc.purdue.edu (Gerrit) (07/25/89)

In article <1515@garcon.cso.uiuc.edu> dorner@pequod.cso.uiuc.edu (Steve Dorner) writes:
>In article <2098@hub.UUCP> dz@cornu.ucsb.edu (Daniel James Zerkle) writes:
>>>cut - like cat, only it would write into the scrap, not stdout
>>>...
>>Cut:    prgname > /tmp/scrap (replace scrap)
>
>The obvious problem with this is that /tmp/scrap means NOTHING to
>Edit, WriteNow, the Digital Library, or anything else that uses
>Cut, Copy, and Paste from the AppKit.
>
>I need to be able to paste into <generic unix command> something I
>have just copied from <whiz-bang NeXT application>, and vice-versa.

I just exerted my eyeballs for an evening and have created a solution
to this problem, using the available goodies on the NeXT.  What you
have described seems to be almost exactly what the Pasteboard class 
was designed for.  The only flaw until now was that there wasn't a
tool to provide generic access to the Pasteboard.

If you have the Tech Docs, Chapter 9, pages 4-7 cover the Pasteboard.
Using the documentation I slapped together a little 3K program (*and*
a man page, too!) which allows you to see what types of things are on
the pasteboard (there are only about 4 "standard" ones) and to fetch
any one of them (iterate if you want more than one), or to put something
on the pasteboard.

It can be picked up from the archive on cc.purdue.edu via anonymous ftp.
It is called "pub/next/source/pb.tar.Z" - retrieve in binary mode.

Gerrit Huizenga
NeXT Workstation Support
Purdue University Computing Center
gerrit@cc.purdue.edu