[comp.sys.apollo] How to cut and paste a column

BEC.SHAPIN@ECLA.USC.EDU (Ross Watkins) (03/25/88)

Rick Allard asks:
>   Has anybody found the need and the solution
>   to cutting a column out of a multicolumn
>   area of characters, a table?  Any Display
>   Manager Jockeys that can help, I'd like to
>   [unreadable...I think it said "buy them lunch"]

I'm hardly a DM Jock, but I have been squeezing DM for awhile, trying 
to get it to look more like EMACS; we have the stuff from MIT, but
I haven't had time to get it up and working.

To cut a rectangular are out of any text file, first mark the top-left
corner, then cursor down to the bottom-right.  Everything in between
will reverse-video, including the stuff outside your rectangle that
you don't want, but don't worry.  Now use the DM command "XD -R",
which will cut the rectangular section from the text, and hold it in
the paste buffer.  The inverse operation--pasting a column into the
middle of a table--is done with the companion command "XP -R" (don't
use the PASTE key!); bear in mind that if things don't line up exactly, 
you will have some reformatting to do.

I use the rectangular-cut command often when coding: to delete the 
first four spaces from 20 lines in a row, say, as when removing a FOR 
loop or other level of code.  I use it so much, in fact, that I have 
bound the sequence to CNTL-W (for cut-window) with the DM command 
"KD ^W XD -R KE", in order to have it easily accessible.  The 
corresponding copy command is "XC -R", but I have never used it.

Also note that by appending "-F pathname" to these DM commands, the 
resulting cut/copy/paste can be written/written/read to/to/from the 
pathname specified.  Please also note that the "rectangle switch" need 
not be present to make use of this pathname redirection switch.  Indeed, 
it is in precisely this manner that "-F pathname" finds its greatest 
utility for me--and a few more bindings:

  cut to a file:        "KD ^D XD -F &'Cut and copy to Pathname: ' KE" 
  copy to a file:       "KD ^C XC -F &'Copy to Pathname: ' KE" 
  paste from a file:    "KD ^I XP -F &'Insert from Pathname: ' KE" 

I find the prompts useful for remebering what I bound to what, and 
in case of typing error.  Play with these until you are comfortable 
with them. 

Enjoy, Ross
-------

Ram-Ashwin@cs.yale.edu (Ashwin Ram) (03/25/88)

In article <12384916270.13.BEC.SHAPIN@ECLA.USC.EDU>, BEC.SHAPIN@ECLA (Ross Watkins) writes:
> Rick Allard asks:
> >   Has anybody found the need and the solution
> >   to cutting a column out of a multicolumn
> >   area of characters, a table?  Any Display
> >   Manager Jockeys that can help, I'd like to
> >   [unreadable...I think it said "buy them lunch"]
> 
> I'm hardly a DM Jock, but I have been squeezing DM for awhile, trying 
> to get it to look more like EMACS

I have a bunch of Emacs-like key bindings for the DM, which I can post if people
are interested.  The hardest one was getting ^K to kill to the end of the line
correctly, making sure it joined the lines if you were already at the end of the
line.  I don't append successive kills to the kill-buffer, however.  Barring
this, the basic control, ESC and ^X key sequences work pretty much as in Emacs.

> To cut a rectangular are out of any text file, first mark the top-left
> corner, then cursor down to the bottom-right.  Everything in between
> will reverse-video, including the stuff outside your rectangle that
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> you don't want, but don't worry.  Now use the DM command "XD -R",
  ^^^^^^^^^^^^^^
> which will cut the rectangular section from the text, and hold it in
> the paste buffer.  The inverse operation--pasting a column into the
> middle of a table--is done with the companion command "XP -R" (don't
> use the PASTE key!); bear in mind that if things don't line up exactly, 
> you will have some reformatting to do.

You can use ECHO -R to highlight the rectangle correctly.

-- Ashwin.

ARPA:    Ram-Ashwin@cs.yale.edu
UUCP:    {decvax,ucbvax,harvard,cmcl2,...}!yale!Ram-Ashwin
BITNET:  Ram@yalecs

mishkin@apollo.uucp (Nathaniel Mishkin) (03/25/88)

Here's something useful to know about the DM's rectangular feature:  If
you set a mark (DR) and turn on rectangular echoing (ECHO -R), then
commands that take a marked region (e.g. XC) are made to operate on a
rectangular region, even if you don't give them (or they don't even take)
a -R switch.  I define L1S (SHIFT-MARK) to be "DR;ECHO -R".  Thus, if
I want to do a non-rectangular cut, I do "L1 (MARK), move cursor, L1AS
(CUT)" and if I want to do a rectangular cut I do "L1S (SHIFT-MARK),
move cursor, L1AS (CUT)".  I.e. I don't need two CUT key bindings (one
with -R and one without) and two COPY key bindings (similarly).  Also
the S (substitute) command obeys rectangularity established by "DR;ECHO
-R", even though S itself doesn't take a -R switch.

Hey, maybe it's not a *silk* purse from a sow's ear, but what about nylon?
-- 
                    -- Nat Mishkin
                       Apollo Computer Inc.
                       Chelmsford, MA
                       {decvax,mit-eddie,umix}!apollo!mishkin

chane@mntgfx.mentor.com (Chane Cullens) (03/30/88)

From article <12384916270.13.BEC.SHAPIN@ECLA.USC.EDU>, by BEC.SHAPIN@ECLA.USC.EDU (Ross Watkins):
> Rick Allard asks:
>>   Has anybody found the need and the solution
>>   to cutting a column out of a multicolumn
>>   area of characters, a table?  Any Display
>>   Manager Jockeys that can help, I'd like to
>>   [unreadable...I think it said "buy them lunch"]
> 
> I'm hardly a DM Jock, but I have been squeezing DM for awhile, trying 
> to get it to look more like EMACS; we have the stuff from MIT, but
> I haven't had time to get it up and working.
> ...
> ....
>   cut to a file:        "KD ^D XD -F &'Cut and copy to Pathname: ' KE" 
>   copy to a file:       "KD ^C XC -F &'Copy to Pathname: ' KE" 
>   paste from a file:    "KD ^I XP -F &'Insert from Pathname: ' KE" 
> 
> I find the prompts useful for remebering what I bound to what, and 
> in case of typing error.  Play with these until you are comfortable 
> with them. 
> 
> Enjoy, Ross
> -------
Try these
The down stroke starts a rectangular mark and the upstroke copies (F3) or cuts (shift F3).
Use control F3 to paste the rectangle (as a rectangle).

kd f3  msg ' Rectangular copy, use f3c to paste';dr;echo -r;kd f3u xc -r rectangle @ke ke
kd f3s msg ' Rectangular cut, use f3c to paste'; dr;echo -r;kd f3u xd -r rectangle @ke ke
kd f3c xp -r rectangle;kd f3u ke@; ke
kd f3u ke

-- 
Chane Cullens                      chane@mntgfx.MENTOR.COM
8500 SW Creekside Place  Beaverton OR 97005 - 503-626-7000
These are my opinions, ideas, thoughts, etc.

nazgul@apollo.uucp (Kee Hinckley) (04/01/88)

In article <25722@yale-celray.yale.UUCP> Ram-Ashwin@cs.yale.edu (Ashwin Ram) writes:
> In article <12384916270.13.BEC.SHAPIN@ECLA.USC.EDU>, BEC.SHAPIN@ECLA (Ross Watkins) writes:
> I have a bunch of Emacs-like key bindings for the DM, which I can post if people
> are interested.  The hardest one was getting ^K to kill to the end of the line
> correctly, making sure it joined the lines if you were already at the end of the
> line.  I don't append successive kills to the kill-buffer, however.  Barring
> this, the basic control, ESC and ^X key sequences work pretty much as in Emacs.
> 

There are a set of Emacs keydefs (and a large number of other keydefs)
shipping in /domain_examples at SR10.  These include incremental search,
a backspace that deletes over word boundries and virtually everything else
you would expect.  I can package them up and mail them to anyone who wants
if you can't wait for SR10.  Just send me mail.
                                                -nazgul

-- 
### {mit-erl,yale,uw-beaver}!apollo!nazgul ###   (Apple ][e ProLine BBS)    ###
###      apollo!nazgul@eddie.mit.edu       ###    nazgul@pro-angmar.uucp    ###
###           nazgul@apollo.uucp           ### (617) 641-3722 300/1200/2400 ###
I'm not sure which upsets me more; that people are so unwilling to accept       responsibility for their own actions, or that they are so eager to regulate     everyone else's.