emacs-devel
[Top][All Lists]
Advanced

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

Re: position on changing defaults?


From: Stefan Monnier
Subject: Re: position on changing defaults?
Date: Sat, 08 Mar 2008 21:32:35 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

>>>> should be allowed to have 0-width).  
>>> Why?
>> Because that's how the region behaves and that's how Emacs rectangles
>> behave, so it's more consistent.

> Visually, this is much more pleasing than having the cursor
> sometimes inside, sometimes outside the rectangle.

Doesn't strike me as something particularly important.

> Also, with CUA-rectangles, the cursor can be at any of the four
> corners of the rectangle.  So having zero size rectangle breaks
> this - which is the main reason I didn't insist on having them.

I don't understand how that's different whether zero-width rectangles
are allowed.

> Finally, CUA-rectangles are not limited by arbitrary line endings;

Again, I don't see how that relates to whether or not zero-width
rectangles are allowed.

> you can expand a rectangle beyond the end of the current line.

Yes, I understand the problems posed by TABs and end of lines when faced
with rectangles, and yes I think the way CUA handles it is perfectly fine.

> So *I* don't want rectangles to work just like the region - I want the
> rectangles to work better than that - also in the presense of tabs in
> the middle of lines!

I meant conceptually.  To the user they should mostly behave "just like
a non-rectangular region".  But of course, there are some
necessary differences.

> I'm _definitely_ in favor of modifying basic commands to behave
> correctly/sensibly if "rectangle-active-p".

I think we all agree on this.

> BTW, shouldn't a command like upcase-region be merged into upcase-word
> so that marking the region (transient-mark-mode active) so that M-u will
> upcase the region instead of the word following the region...

Sounds like a good idea to me.

>>> The self-insert-char feature inserts OUTSIDE the rectangle, so
>>> I don' see how it compares to C-x r t?
>> If the rectangle has 0-width, C-x r t also inserts "outside".
> Ok, but you don't an iota of visible clue as to where the rectangle is.

Now, that is a very good point.  Supporting highlighting of zero-width
rectangles would probably require special-cased code.  E.g. we could add
a vertical line with overlay after-strings, tho that would tend to shift
the rest of the text.  Experimentation would be needed.

> And transient-mark-mode is damn ugly as an indicator for standard 
> rectangles.

Yes, I live with it, but there's no doubt that it's not a feature.

>>> E.g. to put ( ) around all lines of a rectangle, just mark
>>> the rectangle (top-down), and enter ) RET ( .  Can you do that
>>> faster with C-x r t ?
>> No.  But then, I never put (...) around all lines of a rectangle.
> I don't do that often either, but take it as an illustration of the
> principle of inserting on the "active" side of the rectangle.
> And moving the active corner with RET.

Yes, I understand, but I'm not convinced it deserves so
much importance.  These are operations that might better be served by
packages like picture-mode.

>>> BTW, M-s is equivalent to C-x r t (I believe).
>> Except that it applies to one more column, so it can't be used as a form
>> of insert-rectangle, contrary to C-x r t.
>> ... but restricting it to self-insert-char is problematic.
> Just use M-o M-s for that ...  It's still shorter than C-x r t :-)

The problem is not just a question of number of key presses.
C-x r t is good because with a single command I get to do most of the
operations I usually need to do: insert-rectangle (when the rectangle
is empty), delete-rectangle (when the inserted string is empty), and of
course replacement of each line of the rectangle with a given string.

Now I understand that C-x r t works fine with CUA rectangles, but I'm
just not sure that having "active-rectangle" be a minor mode with
special bindings is the way I want to go.


        Stefan




reply via email to

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