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 15:38:42 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

>>> It also gives you the rectangle highlighting (which I think most
>>> users would agree is quite useful) combined with the ability to
>>> use the normal region kill, copy and yank keys also for rectangles.
>>> So there's no need to learn a different command set for rectangles!
>> 
>> Actually, I think the rectangle support is good, although I'd like it to
>> be a bit more like the normal region highlighting (e.g. same color, 

> That would be ok with me (as the default for a new `rectangle' face).

>> C-g should deactivate it,
> It does!  If not, you've found a bug.  Please tell me how to repeat it.

Hmm...  now it seems to work indeed.  Good.
I'll have to investigate some more to try and reproduce the problem.
Oh... I see, I have C-g bound to sm-keyboard-quit which does:

  (defun sm-keyboard-quit ()
    (interactive)
    (sm-special-frames-auto-iconify)
    (keyboard-quit))

I tried replacing the last call by (call-interactively 'keyboard-quit)
but it didn't help.  I think deactivate-mark should do the trick.

>> 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.

>> The C-g part is important: I found it difficult to figure out how to
>> "exit" from the "rectangle-mode".
>> 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.

>> and the special treatment of self-insert-command.  
> I find it extremely useful - but of course, it could be an advanced option.

>> Maybe it's just that I'm used to it, but I find C-x r t to work at
>> least as well if not better (e.g. it's not limited to self-inserting
>> keys).

> 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".

> 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.

If someone needs such a feature, maybe we could add some kind of escape
mechanism so C-x r t could accept "(\0)" kind of like a replace-regexp.
Not sure it's worth the trouble, tho.

> 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.  About half of my uses of C-x
r t is as a form of insert-rectangle.  I understand that you can use the
self-insert-char feature to get the same effect and it's a neat idea,
but restricting it to self-insert-char is problematic.


        Stefan




reply via email to

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