emacs-devel
[Top][All Lists]
Advanced

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

RE: New keybinding suggestion: C-x _ for `shrink-window'


From: Drew Adams
Subject: RE: New keybinding suggestion: C-x _ for `shrink-window'
Date: Fri, 2 Nov 2007 07:28:10 -0700

> >> I think that is worth trying.  To make it convenient we need
> >> a key binding for window-resize.  How about C-x _?
> >
> > FWIW - This is trivial to do with Do Re Mi. Function `doremi' lets you
> > increment or decrement anything repeatedly, using the arrow keys or a
> > mouse wheel (or both). It is made for this kind of thing.
>
> I tested it and it worked okay.  But:
> 1. why using the <up> arrow key to increment the window vertical size?

You can use any key you want. By default, the `up' key increases a value,
and `down' decreases it.

In some cases, it is more logical (can seem more natural) to have `up'
decrease a value - for example, when it decreases frame height (it moves the
frame bottom up). In some cases, it is more logical to have `left' and
`right' increase/decrease a value - for example, to move a frame left/right
or to resize it horizontally.

When two dimensions are used, as for window or frame resizing or frame
positioning, it makes sense to have up/down do something vertical and
left/right do something horizontal.

In this case, if you prefer to use `up' to decrement instead of increment,
that might seem natural for a bottom window (the window bottom moves up) but
unnatural for a top or middle window. It can depend on whether you want to
think in terms of a particular window border moving (up/down) or the window
height/width increasing/decreasing. I chose `up' for increasing window
size - that makes sense for any window.

But again, choose whatever keys you like. To reverse the direction, replace
nil in the call to `doremi' by (- increment). To use `left'/`right', just
`let'-bind the key variables, as in the code I sent for
`window-resize-horizontally'.

(BTW, holding Meta down while you use the arrow keys or mouse wheel gives a
boost, multiplying the increment so change is quicker.)

> 2. It doesn't really take care of what border do you want to act on.

I don't know what you mean by "take care of what border". No, it simply
resizes the window, by calling `shrink-window(-horizontally)'. If that
function is not what you want, then use another that does what you want.

>    The `resize-window' I proposed in this thread, while definitely ugly,
>    moves the left border when you use the left key `l', the right border
>    when you use the right key `r', etc.  It is the most usable solution
>    I've tested so far.

Nothing wrong with that, if that's what you want.

My point was that Do Re Mi is completely general. You can use it to
increase/decrease anything incrementally (or use it to cycle among
enumeration values).

In this case, there was an existing incrementator, `shrink-window'
ready-to-hand. But Do Re Mi is just as easy to use if there is only an
absolute setting function instead of an incrementor. For example, you can
pass it a function that simply sets the window size, instead of incrementing
it - Do Re Mi will then take do the incrementing itself.






reply via email to

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