From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: virtual space? Date: Tue, 21 Oct 2003 15:04:35 GMT Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <87y8vgbhdc.fsf@lucien.dreaming> <1c58a7c3.0310210047.2e379e8b@posting.google.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1066750021 15602 80.91.224.253 (21 Oct 2003 15:27:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 21 Oct 2003 15:27:01 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Oct 21 17:26:57 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AByPQ-0003KJ-01 for ; Tue, 21 Oct 2003 17:26:56 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AByNk-0001uu-CK for geh-help-gnu-emacs@m.gmane.org; Tue, 21 Oct 2003 11:25:12 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!cyclone.bc.net!snoopy.risq.qc.ca!charlie.risq.qc.ca!53ab2750!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 45 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 Original-NNTP-Posting-Host: 132.204.24.42 Original-X-Complaints-To: abuse@umontreal.ca Original-X-Trace: charlie.risq.qc.ca 1066748675 132.204.24.42 (Tue, 21 Oct 2003 11:04:35 EDT) Original-NNTP-Posting-Date: Tue, 21 Oct 2003 11:04:35 EDT Original-Xref: shelby.stanford.edu gnu.emacs.help:117482 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:13413 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:13413 > Hmm, come to think of it, I can actually find a valid use for it. > Imagine this text in a buffer: > blah blah blah > blah blah<-buffer ends here > If you have the buffer text above, it is *impossible* to copy a > rectangle with all the content of the buffer without needing to add > extra spaces at the end of the last line to get the cursor to the same > column as the third "blah" on the first line. Right? Of course you can: place point at beginning of second line press C-SPC, then press C-p C-e to go to the end of first line and C-x r k to kill the rectangle. But your point does hold in the following case: blabla blablabla blabla > Having a virtual cursor would solve the problem. There are two other ways to solve the problem: - use SPC instead of C-f (if you also use transient-mark-mode, this will turn off the mark, so you'll need to hit C-x C-x when done to reactivate it). - use CUA, which has a very good support for rectangles, including special commands to highlight/grow/shrink/shift the currently selected rectangle, and which inserts spaces as needed, just like picture-mode. > Anyway, this is no big problem for *me*. Neither is it for me. At first, it would seem like it'd be very difficult to implement, but now that I think about it, I believe it can be done purely in elisp: When going "past the last char" of a line, just add an overlay at the end of the line with an `after-string' property of " ". At least here (Emacs-CVS), it seems to move the cursor according to the number of spaces you've put, so you can place the cursor where you want on screen without modifying the buffer text. The tricky part will be to make the other commands work correctly by replacing the overlay with actual spaces before doing an insertion. Stefan