From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Make `C-x {' and `C-x }' repeatable Date: Tue, 21 May 2013 21:34:04 +0300 Organization: JURTA Message-ID: <87mwrombc3.fsf@mail.jurta.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1369161609 4090 80.91.229.3 (21 May 2013 18:40:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 May 2013 18:40:09 +0000 (UTC) Cc: emacs-devel@gnu.org To: Gauthier =?iso-8859-1?Q?=D6stervall?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 21 20:40:08 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UerTk-0007Ca-0E for ged-emacs-devel@m.gmane.org; Tue, 21 May 2013 20:40:08 +0200 Original-Received: from localhost ([::1]:36067 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UerTj-0000m1-KE for ged-emacs-devel@m.gmane.org; Tue, 21 May 2013 14:40:07 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37332) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UerTc-0000fy-EO for emacs-devel@gnu.org; Tue, 21 May 2013 14:40:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UerTX-0005TF-QX for emacs-devel@gnu.org; Tue, 21 May 2013 14:40:00 -0400 Original-Received: from ps18281.dreamhost.com ([69.163.218.105]:41158 helo=ps18281.dreamhostps.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UerTX-0005T9-Kf for emacs-devel@gnu.org; Tue, 21 May 2013 14:39:55 -0400 Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 6473D258B9E91C; Tue, 21 May 2013 11:39:49 -0700 (PDT) In-Reply-To: ("Gauthier \=\?iso-8859-1\?Q\?\=D6stervall\=22's\?\= message of "Mon, 20 May 2013 21:59:06 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 69.163.218.105 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:159721 Archived-At: > Ever since I started using emacs and tried to say good bye to my > mouse, I have felt that the resizing of windows with `C-x }' and > `C-x {' is too cumbersome to use. Thanks for this useful feature. I am experiencing the same difficulties with `C-x }' and `C-x {', so your feature would be of a great help. > Please tell me if I should have done that differently, and I'll > try to implement it. Please make the keymap user-customizable, e.g. if you'll create a separate keymap with a name like `window-size-adjust-keymap' then users would be able to add more keybindings in ~/.emacs like: (define-key window-size-adjust-keymap [right] 'enlarge-window-horizontally) (define-key window-size-adjust-keymap [left] 'shrink-window-horizontally) (define-key window-size-adjust-keymap [down] 'enlarge-window) (define-key window-size-adjust-keymap [up] 'shrink-window) to use arrow keys for window resizing. Then having such map you could just add one line: (set-temporary-overlay-map window-size-adjust-keymap) to the end of all these four functions to implement this feature. I mean changing existing commands: (defun shrink-window-horizontally (delta) (interactive "p") (shrink-window delta t)) to (defun shrink-window-horizontally (delta) (interactive "p") (shrink-window delta t) (set-temporary-overlay-map window-size-adjust-keymap)) and the feature will just work without creating a "dispatcher" kind of function `window-size-adjust'. This will preserve the current global keybindings (i.e. `shrink-window-horizontally' still bound to `C-x {' etc.) and provide more customizability. Then remaining possible improvements would be adding an option to disable this feature (I think it should be enabled by default), adding an informative echo-area message about available keybindings, adding a keybinding (like `RET' in `isearch-mode') to exit a keysequence of resizing keys, etc. > One problem is that there is currently no standard key binding for > (shrink-window). It's very difficult to find a free global keybinding for such less frequently used commands. But there is no need because users could use the existing global keybindings to initiate a window-resizing keysequence and use other keys from the map for more fine-grained resizing.