From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: New keybinding suggestion: C-x _ for `shrink-window' Date: Fri, 2 Nov 2007 07:28:10 -0700 Message-ID: References: <87prysd8n6.fsf@bzg.ath.cx> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1194013757 8850 80.91.229.12 (2 Nov 2007 14:29:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 2 Nov 2007 14:29:17 +0000 (UTC) To: "Bastien" , Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 02 15:29:19 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1InxWJ-00017H-1q for ged-emacs-devel@m.gmane.org; Fri, 02 Nov 2007 15:29:11 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1InxW9-0004j3-1c for ged-emacs-devel@m.gmane.org; Fri, 02 Nov 2007 10:29:01 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1InxVa-0004HM-J1 for emacs-devel@gnu.org; Fri, 02 Nov 2007 10:28:26 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1InxVZ-0004GK-HZ for emacs-devel@gnu.org; Fri, 02 Nov 2007 10:28:26 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1InxVZ-0004GA-Cp for emacs-devel@gnu.org; Fri, 02 Nov 2007 10:28:25 -0400 Original-Received: from agminet01.oracle.com ([141.146.126.228]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1InxVY-0004c2-WB for emacs-devel@gnu.org; Fri, 02 Nov 2007 10:28:25 -0400 Original-Received: from agmgw1.us.oracle.com (agmgw1.us.oracle.com [152.68.180.212]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id lA2ESLIl006025; Fri, 2 Nov 2007 09:28:21 -0500 Original-Received: from acsmt351.oracle.com (acsmt351.oracle.com [141.146.40.151]) by agmgw1.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id lA2ESJTv023815; Fri, 2 Nov 2007 08:28:20 -0600 Original-Received: from 141.144.89.107 by acsmt351.oracle.com with ESMTP id 3338817481194013687; Fri, 02 Nov 2007 07:28:07 -0700 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: <87prysd8n6.fsf@bzg.ath.cx> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 Importance: Normal X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:82356 Archived-At: > >> 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 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.