all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
Subject: Re: virtual space?
Date: Tue, 21 Oct 2003 15:04:35 GMT	[thread overview]
Message-ID: <jwv65ii8wwd.fsf-monnier+gnu.emacs.help@vor.iro.umontreal.ca> (raw)
In-Reply-To: 1c58a7c3.0310210047.2e379e8b@posting.google.com

> 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

  reply	other threads:[~2003-10-21 15:04 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-19 21:31 virtual space? Michael Durland
2003-10-19 21:52 ` Sudarshan S. Chawathe
2003-10-19 23:25   ` Michael Durland
2003-10-20  5:36     ` Björn Lindström
2003-10-21  1:52       ` Michael Durland
2003-10-21  4:07         ` Dan Anderson
2003-10-21  5:44         ` Eli Zaretskii
2003-10-21  8:47         ` Barman Brakjoller
2003-10-21 15:04           ` Stefan Monnier [this message]
2003-10-22  1:33             ` Michael Durland
     [not found]         ` <mailman.2047.1066715377.21628.help-gnu-emacs@gnu.org>
2003-10-22  1:26           ` Michael Durland
2003-10-22 14:37             ` Eli Zaretskii
     [not found]             ` <mailman.2213.1066834114.21628.help-gnu-emacs@gnu.org>
2003-10-22 15:55               ` Kevin Rodgers
2003-10-22 17:44                 ` Eli Zaretskii
     [not found]                 ` <mailman.2225.1066844986.21628.help-gnu-emacs@gnu.org>
2003-12-02 21:09                   ` Kai Grossjohann
2003-10-22 17:29               ` Stefan Monnier
2003-12-02 21:04         ` Kai Grossjohann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv65ii8wwd.fsf-monnier+gnu.emacs.help@vor.iro.umontreal.ca \
    --to=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.