emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Highlighting rectangles?


From: Stefan Monnier
Subject: Re: Highlighting rectangles?
Date: Sun, 04 Nov 2001 15:23:43 -0500

>       Of course, Emacs' region can't do that
>     right now and the function that use the region wouldn't know
>     how to deal with it, but one way we could do it (I thought at the time)
>     is that when we have such a non-contiguous region applied to a function
>     whose interactive spec says `r' is to call the function repeatedly
>     on the various contiguous subparts of the region.
> 
> I guess call-interactively could do this.
> It will get the right results for many functions.
> But it will be wrong for some.  Consider prepend-to-buffer:
> if it operates on the subregions in order from top to bottom,
> the effect will be to reverse their order in the destination buffer.

Indeed.  It's just a sensible default.

> So there has to be another way for a command to specify that it wants
> to be called once, with full info on the discontinuous region, so it
> can handle all the parts in one go.

Of course, that default behavior should only be used for functions
that don't know better (or don't need to know better).
So we would have to add a way for a function to provide a different
behavior.  For example by using the `R' interactive spec (rather
than `r') in which case the region would be passed as a list of pairs.

Eli also pointed out:
> FWIW, we might need something like that anyway for the bidirectional
> support.  That's because a portion of the display that looks
> contiguous on the screen might not be contiguous in the buffer (due to
> logical-to-visual reordering).

I never thought about this (good old latin-only mindset).  Is it more
natural for people to select text based on its visual representation
(i.e. a contiguous part of the display but a non-contiguous part
of the buffer) or based on its underlying representation (i.e. a
contiguous piece of buffer, but a set of non-contiguous parts of
the display).  Or is it just another incarnation of the usual WYSIWYG
flame war.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]