Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!bbn!jr@bbn.com From: jr@bbn.com (John Robinson) Newsgroups: gnu.emacs Subject: Re: block manipulation Keywords: is there a way to manipulate columns Message-ID: <51662@bbn.COM> Date: 2 Feb 90 16:11:23 GMT References: <1418@awdprime.UUCP> Sender: news@bbn.COM Reply-To: jr@bbn.com (John Robinson) Organization: BBN Systems and Technologies Corporation, Cambridge MA Lines: 42 In-reply-to: ron@woan.austin.ibm.com (Ronald S. Woan/2113674) In article <1418@awdprime.UUCP>, ron@woan (Ronald S. Woan/2113674) writes: >Is there any support in GNU EMACS for manipulating blocks of texts >(not regions) spanning multiple lines? Or how about a real simple one, >how do you get rid of a column without having to write a lisp >functions to go down line by line deleting a particular character >position? You want the rectangle package (I had to read a while before I understood what you menat by "blocks"; in emacs they are called rectangles). For starters, (apropos "rectangle") clear-rectangle Function: Blank out rectangle with corners at point and mark. copy-rectangle-to-register C-x R Function: Copy rectangular region into register REG. delete-extract-rectangle Function: Return and delete contents of rectangle with corners at START and END. delete-rectangle Function: Delete (don't save) text in rectangle with point and mark as corners. extract-rectangle Function: Return contents of rectangle with corners at START and END. insert-rectangle Function: Insert text of RECTANGLE with upper left corner at point. kill-rectangle Function: Delete rectangle with corners at point and mark; save as last killed one. open-rectangle Function: Blank out rectangle with corners at point and mark, shifting text right. yank-rectangle Function: Yank the last killed rectangle with upper left corner at point. (note: C-x r is the default binding for copy-rectangle-to-register, but I rebind it to make room for mh-rmail. Beats me why only that one function of the whole list gets a default binding...) Basically, a rectangle is the characters within the box formed by point and mark. Empty positions are filled up with spaces as necessary. -- /jr, nee John Robinson Life did not take over the globe by combat, jr@bbn.com or bbn!jr but by networking -- Lynn Margulis