Closed mattfidler closed 3 years ago
It also recorded the last-command
correctly. For kill-line
this should work fine.
Some things probably shouldn't use this, though. Shift selection seems to break with a simple passthrough.
For gnus, C-k
does not just kill the one line. It runs gnus-summary-kill-same-subject
, which kills a group of lines. It is sort of like killing a block. I do not see an equivalent ergoemacs binding.
I am also a bit concerned about how this is implemented. Enabling and disabling ergoemacs-mode sounds error prone.
Did you try it? It simply enables and disables the keymaps.
I must have messed up something in my initial test. I just did a proper test, and it works correctly.
Part of my unease with the implementation here is that I can not ask for all of the bindings in a gnus buffer and get a list that includes the binding of M-d
to gnus-summary-kill-same-subject
. I would prefer to manually bind all of the necessary keys. Then there is no magic.
Based on your prior feedback;
ergoemacs-mode
keys to ergoemacs-mode-regular
. This way the mode indicator is never modified while swapping keys (and would possibly avoid any unknown problems by avoiding convention).kill-line
in the standard ergoemacs-mode
keymap as the default binding.ergoemacs--send-emacs-keys-map
. When enabled with the variable ergoemacs-mode-send-emacs-keys
, then emacs keys are sent, otherwise the bindings remain as is.This means, by adding the following lines:
(setq ergoemacs-mode-send-emacs-keys nil
ergoemacs-mode-unbind-emacs-keys nil)
The C-k
would work as you thought it should in the past.
Part of my unease with the implementation here is that I can not ask for all of the bindings in a gnus buffer and get a list that includes the binding of M-d to gnus-summary-kill-same-subject. I would prefer to manually bind all of the necessary keys. Then there is no magic.
I think it is easier to describe the keys to show M-d
is gnus-summary-kill-same-subject
in the binding than to support manually binding each of the keymaps. However, this solution allows you to try different approaches.
I accidentally merged the opposite way...
@wlandry
Now the C-h '
shows the ergoemacs-mode
keymap and describes the key ergoemacs key translations in the current buffer.
So, you should be able to see that M-d
is gnus-summary-kill-same-subject
by running that command in the gnus buffer
I do not think that C-h '
should change depending on the minor mode. The main output of C-h '
is the picture, which is something that you can tape next to your monitor as a cheat sheet. The binding for M-d
should show up when I type C-h b
.
In any event, when I run C-h '
in a gnus summary buffer, it shows that M-d
is bound to kill-line
. Following the link for that function leads to documentation that starts
Its keys are remapped to ‘ergoemacs-kill-line’. Without this
remapping, it would be bound to M-d, <deleteline>.
So there is still no sign that it will end up running gnus-summary-kill-same-subject
.
Hm. I show no remaps. I will try again at this later...
@wlandry:
This is a proof of concept, but should support the kill line equivalent key in
gnus
.If you could try it out and it seems to work for you, I can try to apply it more broadly.
Unlike the last edition:
ergoemacs-mode
pushes the emacs keys to the unread keys stack (and tags it to be unrecorded).ergoemacs-mode
is turned off for that one command.ergoemacs-mode
is turned back on.For me, the
kill-line
seems to work. I am unsure if it recorded the last command correctly.