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: Bastien
Subject: Re: New keybinding suggestion: C-x _ for `shrink-window'
Date: Fri, 16 Nov 2007 17:13:45 +0000
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.0 (gnu/linux)

Stefan Monnier <address@hidden> writes:

> I'm not sure what method you use instead, but I see two choices:
>
> - use a keymap with high priority.

This is what I currently use, with a simple (use-local-map ...) in the
definition of `window-resize-mode'.

> - use `read-event' in a loop.

This what I used in window-edit -- but this is history now.

> If using the first, then overriding-terminal-local-map is about as high
> priority as it gets.  And it's terminal-specific so you should be able
> to use it independently, from two terminals at the same time (assuming
> the rest of the code is careful not to abuse global vars when
> terminal-parameters should be used instead).

Ok, thanks for the explanations.  

> If using the second, you lose most of the benefits of the top-level
> loop: you don't call pre/post-command-hook, you may prevent filters from
> running, you have to be careful with input-decode-map, function-key-map,
> etc...

Which are some of the reasons why I switched back to the other solution.

> Note that using overriding-terminal-local-map is not necessarily a
> piece of cake either.

I gave overriding-terminal-local-map a try. 

The problem is that when `window-resize-mode' sends an error, the point
goes in the minibuffer and the active keymap is still the one defined by
`overriding-terminal-local-map'.  This is rather confusing since
window-resize-mode-map redefines the arrow keys and that these keys
might be useful in the minibuffer.  I don't know how to avoid this.

Another question about keymaps in general: in window-resize-mode the
buffer is read-only and I'd like to prevent errors to be thrown when the
user hits a key that should insert itself in another mode.  

So I tried to substitute 'self-insert-command with a variant of my own,
with 'self-insert-command in (ignore-errors ...) or (condition-case...).
But it seems then that those keys which are bound to a command -- other
than 'self-insert-command -- are not working anymore.  

Do you have an idea?

-- 
Bastien




reply via email to

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