5

In the past when this happened, I was able to google the answer with no problem, but this time nothing's coming up.

  • 2
    Letter keys are normally bound to `self-insert-command`, so you can bind it to that function again. Are you asking about a universal approach to rebind a key back to it's original keybinding? –  Oct 04 '18 at 21:58
  • Can anyone explain why this was downvoted? I spent 15 minutes googling and SO couldn't suggest an answer. A downvote seems incredibly unwelcoming, particularly since StackExchange owners have recently blogged about how they're trying to change the unwelcoming nature of the StackExchange sites. – Michael Terry Oct 04 '18 at 22:02
  • 1
    I upvoted it. ;-) A guess is that someone thought it was too basic a question. But there is no question too basic. @DoMiNeLa10: Please consider posting your comment as an answer. OP: You can *accept* that answer, if you feel it's correct (which I think it is). – Drew Oct 04 '18 at 22:15
  • You are right that whoever voted down could have, for the benefit of the community, explained why this question is not written in an acceptable form for SE. Please read the [guidelines](https://stackoverflow.com/help/how-to-ask). Basically it is preferred to write a complete question (not just in the subject of the post) and to phrase it in a manner that will be useful for the next member that searches for a solution. keep posting @MichaelTerry – manandearth Oct 04 '18 at 22:19
  • I'll be interested to see if this question gets visibility in google for any of the queries I tried. My feeling is that the world would be a better place if every basic question had an answer at the top of the serps. – Michael Terry Oct 04 '18 at 22:19
  • Is this different from [Default key binding is lost, how to restore it?](https://emacs.stackexchange.com/questions/26607/default-key-binding-is-lost-how-to-restore-it) – npostavs Oct 04 '18 at 22:21
  • Unless I'm missing something, `self-insert-command` doesn't appear on that page, which is exactly what I needed. – Michael Terry Oct 04 '18 at 22:27
  • @MichaelTerry It does suggest the more general method of running a new instance of Emacs and asking it which command the key is bound to; but the answer also covers so many other aspects that this solution for your specific problem might not be obvious. – phils Oct 04 '18 at 22:38
  • @manandearth, So I read those guidelines. Where on that page does it say you need to redundantly post the question in the post body? If that adds nothing, what's the point? Also, it talks about "more likely to get an answer". It doesn't say it's unacceptable. It doesn't say it deserves downvotes. Is it possible that this sort of nitpickery is actually more unwelcoming than helpful? – Michael Terry Oct 04 '18 at 22:41
  • @phils, Right, so this Q&A has a much better UI for someone who just needs the answer to this question and will be much better optimized for ranking in search engines for this Q&A. – Michael Terry Oct 04 '18 at 22:43
  • FWIW https://emacs.stackexchange.com/q/16738 is the nearest thing to a duplicate that I found in a quick search here. I think this Q&A is fine, though; terse though it may be. – phils Oct 04 '18 at 22:43
  • @phils, Aha, good chance that was the post I found in the past. Unfortunately I'm of only average intelligence, so I could not find it again this time. – Michael Terry Oct 04 '18 at 22:47
  • 2
    Well, I was searching for `self-insert-command` on the basis that it was the most likely way to turn up a duplicate :) I can't comment on how easy it was to find if you didn't *already* know exactly what you were looking for. – phils Oct 04 '18 at 22:50
  • Note that the description text of your question is more like a comment. Normally it should be the long version of your question. Stuff like the exact conditions under which the problem occurs, system information, a minimal example and instructions how to reproduce the problem. Maybe that was the reason why somebody down-voted your question. – Tobias Oct 05 '18 at 11:00
  • Specifically in this case, adding that you know about `global-set-key`, but you aren't sure what to pass for `COMMAND` would make the question a lot clearer. – npostavs Oct 05 '18 at 18:44

1 Answers1

2

Letter keys are normally bound to self-insert-command, so you can simply evaluate this:

(global-set-key (kbd "x") #'self-insert-command)

Of course, you'll have to replace that x with whatever key you want to rebind. You can eval this by yanking it into a scratch buffer, putting point after it and typing C-x C-e or you can enter it in the M-: prompt.