all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: "Gauthier Östervall" <gauthier@ostervall.se>
Cc: emacs-devel@gnu.org
Subject: Re: [PATCH] Make `C-x {' and `C-x }' repeatable
Date: Tue, 21 May 2013 21:34:04 +0300	[thread overview]
Message-ID: <87mwrombc3.fsf@mail.jurta.org> (raw)
In-Reply-To: <CAM8gEgj9ufdxaMojxL2bfoc+oMEKhFUJYxvmWP0dxdyaQPcb8g@mail.gmail.com> ("Gauthier \=\?iso-8859-1\?Q\?\=D6stervall\=22's\?\= message of "Mon, 20 May 2013 21:59:06 +0200")

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



  parent reply	other threads:[~2013-05-21 18:34 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-20 19:59 [PATCH] Make `C-x {' and `C-x }' repeatable Gauthier Östervall
2013-05-21  9:58 ` Vitalie Spinu
2013-05-21 13:53   ` Gauthier Östervall
2013-05-21 18:34 ` Juri Linkov [this message]
2013-05-22 17:44   ` Drew Adams
2013-05-22 18:55     ` Juri Linkov
2013-05-22 21:39       ` Drew Adams
2013-05-22 22:08         ` Stefan Monnier
2013-05-22 23:53           ` Drew Adams
2013-05-23  0:18             ` chad
2013-05-23 16:19               ` Drew Adams
2013-05-23 16:48                 ` Stefan Monnier
2013-05-23 19:52                   ` Drew Adams
2013-05-24  4:53                     ` Stephen J. Turnbull
2013-05-24 15:55                       ` Drew Adams
2013-05-24 17:00                         ` Stephen J. Turnbull
2013-05-22 21:47       ` Stefan Monnier
2013-05-22 22:24         ` Stefan Monnier
2013-05-22 23:53         ` Drew Adams
2013-05-23 22:30         ` Juri Linkov
2013-05-24  3:58           ` Stefan Monnier
2013-05-22 19:05 ` Stefan Monnier
2013-05-23 12:21   ` Gauthier Östervall
2013-05-23 13:41     ` Stefan Monnier
2013-05-23 22:04       ` Juri Linkov
2013-05-24  9:38         ` Alan Mackenzie
2013-05-24 20:31           ` Juri Linkov
2013-05-25 20:01             ` Alan Mackenzie
2013-05-25 20:40               ` Juri Linkov
2013-06-02 21:05                 ` isearch-allow-prefix [Was: [PATCH] Make `C-x {' and `C-x }' repeatable] Alan Mackenzie
2013-06-04 18:03                   ` Juri Linkov
2013-06-04 21:24                     ` Alan Mackenzie
2013-06-05  8:23                       ` Juri Linkov
2013-06-05 21:02                         ` Alan Mackenzie
2013-06-06  6:07                           ` isearch-allow-move [Was: isearch-allow-prefix] Juri Linkov
2013-06-06 12:45                             ` Stefan Monnier
2013-06-06 15:07                               ` Juri Linkov
2013-06-06 15:43                                 ` Drew Adams
2013-06-06 16:39                                 ` Stefan Monnier
2013-06-07  7:07                                   ` Juri Linkov
2013-06-06 20:07                             ` Alan Mackenzie
2013-06-07  6:59                               ` Juri Linkov
2013-06-07 10:30                                 ` Alan Mackenzie
2013-06-07 19:30                                   ` Juri Linkov
2013-06-09 20:09                                     ` Juri Linkov
2013-06-11 19:35                                       ` Juri Linkov
2013-06-07 20:04                               ` Juri Linkov
2013-06-09 12:07         ` [PATCH] set-temporary-overlay-map improvement and make windresize exit on other commands Vitalie Spinu
2013-06-09 16:03           ` Stefan Monnier
2013-06-09 17:12             ` Vitalie Spinu
2013-06-13 20:44               ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mwrombc3.fsf@mail.jurta.org \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.org \
    --cc=gauthier@ostervall.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.