issue23: Support killing a buffer in the switch-to-buffer interaction

Priority: wish Status: resolved
Messages
msg28 (view) Author: nicktastic Date: 2008-09-19.17:43:56
This will involve adding a command-specific keymap to the minibuffer call that reads the buffer name.

C-k is the natural binding for this action, following the emacs convention. We lose the default kill-line
binding in this case, but when was the last time you wanted to use kill-line while switching buffers?
msg29 (view) Author: nicktastic Date: 2008-09-19.17:51:26
C-k is already bound to minibuffer-cmd_deleteToEndOfLine. Alternative suggestions welcome.

I have a working implementation of this feature, however there is a problem. Invalidating a buffer will
result in error from the completer, as it will access fields in the invalidated buffer when
'text_entry_minibuffer_state' attempts to update the completion list. The crux of the biscuit is that the
'data' field of the completer returned by all_word_completer() is calculated when the completer is
created, and can't be updated afterwards. I tried installing a new completer with up-to-date 'data',
however it would appear that coroutines in methods of 'text_entry_minibuffer_state' close around the
initial completer, which results in failure when they are resumed with a new completer.

I have added an optional $keymap argument to minibuffer.read_buffer() and minibuffer.read() which allows
custom keymaps (which ostensibly extend 'minibuffer_keymap') to be in used during minibuffer commands.
This seems generally useful for other commands which want custom keymaps for manipulating selected
minibuffer completions. (Indeed, retroj thought minibuffer keymap overlays were already implemented, but
it appears that 'minibuffer_keymap' is hard-coded in 'text_entry_minibuffer_state'.) My ideal
implementation adds a 'read_buffer_minibuffer_keymap' which is installed anytime minibuffer.read_buffer()
is called, thus exposing this kill functionality to any command that works with buffer lists via the
minibuffer (admittedly, by only two commands at the moment, 'switch-to-buffer' and 'kill-buffer', however
I find it likely that, as conkeror evolves, more commands will be added which manipulate the list of
buffers, and it seems desirable that these be able to re-use such features as this one via
'read_buffer_minibuffer_keymap').

I suspect that methods to update the completer and the list widget will need to be added for the ideal
implementation to work so that the minibuffer doesn't need to be destroyed and recreated.
msg470 (view) Author: retroj Date: 2009-10-16.21:11:07
thanks for the reminder.. done!
History
Date User Action Args
2009-10-16 21:11:07retrojsetstatus: chatting -> resolved
messages: + msg470
2008-09-19 17:51:26nicktasticsetstatus: unread -> chatting
messages: + msg29
2008-09-19 17:43:56nicktasticcreate