1
votes

I am learning emacs and have started using it for ruby programming. As a newbie to emacs, I configured it based upon the Prelude package by bbatsov (https://github.com/bbatsov/emacs-prelude) which by and large is great. I am using the Mac Emacs 24 pretest package from http://emacsformacosx.com/builds.

The problem I have is probably not related to that - not sure if it's a bug in the ruby-mode package.

When I'm in ruby-mode and I hit the "k" key, as if typing "knackered", the "k" key acts as a prefix key ("k" isn't inserted in the buffer but shows in the mini-buffer). The only way I can insert a "k" character in ruby-mode is C-q k, which is really annoying.

I've raked through all the documentation about keymaps and have been through all the config files (ELPA, modules, custom, init, etc) and can find nothing that switches this on, including in the ruby-mode config files. I am very confused and a bit frustrated. Can anyone shine any light on this?

2

2 Answers

1
votes

I have no idea what switches that on, but you should be able to override it using something like:

(local-set-key (kbd "k") 'self-insert-command)

You can run this using M-:. You can also put this line in a ruby mode hook.

0
votes

So, I'm an emacs noob myself and I had the same problem. I found that I had created a custom yasnippet and in the auto-generated template there was a directive to bind the snippet to a key: binding: "keybinding". Once I removed that, the problem went away.

TL;DR

I found it because when I typed C-h m to list the active modes, I saw some strange stuff about about a K E Y B I N D I N Prefix Command. After I saw that, I hit C-h k keybinding (to show what command was bound to that set of keystrokes) and it came up with some error message that also included the snippet I remembered writing a day or so ago. I went to the yasnippet directory and edited the snippet, and my problem went away.

I know that you fixed your problem already, but for anyone else who might run into this issue, but doesn't want to just override the 'k' key to work as expected, you might try looking for a snippet with a binding: "keybinding" directive.