[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: position on changing defaults?
From: |
Kim F. Storm |
Subject: |
Re: position on changing defaults? |
Date: |
Sun, 09 Mar 2008 00:38:02 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1.91 (gnu/linux) |
Stefan Monnier <address@hidden> writes:
>>> 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.
Well, I've never had a use for them in practice - and one of the
features of CUA rectangles is that the cursor is INSIDE one of the
rectangle corners -- namely the corner which you expand by moving the
cursor.
Visually, this is much more pleasing than having the cursor
sometimes inside, sometimes outside the rectangle.
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.
Finally, CUA-rectangles are not limited by arbitrary line endings;
you can expand a rectangle beyond the end of the current line.
For example, with standard rectangles, how can you mark the
text marked with X'es in the following sample:
...............
........XXXXX....
........XXX
........XXXXX..
........X
............
?
With CUA rectangles, you simply place the cursor at the
top-left X, and hit C-RET, down x 4, right x 4. Try it!
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!
>>> Also I'm not convinced by the special M-foo bindings
>> Some or all of them?
>
> All of them.
>
>> What's the alternative?
>
> What do you mean? I've never used any of them, yet managed to edit my
> texts just fine ;-)
>
> Basically, I want rectangle regions to behave pretty much *exactly* like
> normal regions (the only difference is that it sets a var
> `region-is-rectangle' and for that reason it is displayed differently)
> and then some commands (like C-w ...) behave differently depending on
> whether the region was rectangle or not, and other commands only work
> with one of the two kinds of regions.
I'm _definitely_ in favor of modifying basic commands to behave
correctly/sensibly if "rectangle-active-p".
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...
>> 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.
And transient-mark-mode is damn ugly as an indicator for standard
rectangles.
>
>> 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.
>> 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 :-)
--
Kim F. Storm <address@hidden> http://www.cua.dk
- Dangerous shell commands? (was: CUA mode's C-RET binding), (continued)
- Re: CUA mode's C-RET binding [was: position on changing defaults?], Mathias Dahl, 2008/03/11
- RE: CUA mode's C-RET binding [was: position on changing defaults?], Drew Adams, 2008/03/11
- Re: CUA mode's C-RET binding [was: position on changing defaults?], Mathias Dahl, 2008/03/13
- RE: CUA mode's C-RET binding [was: position on changing defaults?], Drew Adams, 2008/03/13
- Re: position on changing defaults?, Richard Stallman, 2008/03/11
- Re: position on changing defaults?, Kim F. Storm, 2008/03/08
- Re: position on changing defaults?, Stefan Monnier, 2008/03/08
- Re: position on changing defaults?,
Kim F. Storm <=
- Re: position on changing defaults?, Miles Bader, 2008/03/08
- Re: position on changing defaults?, Stefan Monnier, 2008/03/08
- Re: position on changing defaults?, Richard Stallman, 2008/03/09
- Re: position on changing defaults?, Chong Yidong, 2008/03/10
- Re: position on changing defaults?, Kim F. Storm, 2008/03/11
- Re: position on changing defaults?, Kim F. Storm, 2008/03/08
- Making the command loop mode-dependent [was: position on changing defaults?], Alan Mackenzie, 2008/03/09
- Re: position on changing defaults?, Richard Stallman, 2008/03/06
- Re: position on changing defaults?, Kim F. Storm, 2008/03/07
- Re: position on changing defaults?, Richard Stallman, 2008/03/08