From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Michael Durland" Newsgroups: gmane.emacs.help Subject: Re: virtual space? Date: Wed, 22 Oct 2003 01:33:05 GMT Organization: EarthLink Inc. -- http://www.EarthLink.net 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 X-Trace: sea.gmane.org 1066787330 11565 80.91.224.253 (22 Oct 2003 01:48:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 22 Oct 2003 01:48:50 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 22 03:48:47 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 1AC87D-0000aZ-00 for ; Wed, 22 Oct 2003 03:48:47 +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 1AC858-0005Cm-Ls for geh-help-gnu-emacs@m.gmane.org; Tue, 21 Oct 2003 21:46:38 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread4.news.pas.earthlink.net.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 33 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Original-NNTP-Posting-Host: 165.247.203.124 Original-X-Complaints-To: abuse@earthlink.net Original-X-Trace: newsread4.news.pas.earthlink.net 1066786385 165.247.203.124 (Tue, 21 Oct 2003 18:33:05 PDT) mdurland@ix.netcom.com Original-NNTP-Posting-Date: Tue, 21 Oct 2003 18:33:05 PDT Original-Xref: shelby.stanford.edu gnu.emacs.help:117519 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:13450 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:13450 "Stefan Monnier" wrote in message news:jwv65ii8wwd.fsf-monnier+gnu.emacs.help@vor.iro.umontreal.ca... > > Having a virtual cursor would solve the problem. > > > 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. > This sounds cool! So is it possible to implement a virtual cursor entirely as an overlay? I'm imagining that the real cursor would have to be hidden, but always follow the virtual cursor where there is text. Where there isn't text, the virtual cursor would travel away from the real cursor. Then when the virtual cursor got back on to real text, they would sync up again. If text was inserted at the virtual cursor, yes whitespace would need to be added to pad the real cursor out to the virtual cursor, but this is expected. I know a little about overlays, but not enough to write one from scratch. I'm learning. Any guidance down this path would be appreciated. Thanks, Mike