Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using emacs23 installed in ubuntu 10.04

Tried to define a keybinding by using

M-x define-key "key" 'function

in the mimi buffer, but it told me that "[No Match]"

Tried to put

(define-key ctl-x-map "1" 'goto-line)

in my .emacs file, still the keybinding is not changed, c-x-l still invoke the 'count lines in page' function.

any clue why?

share|improve this question
up vote 2 down vote accepted

The first one fails because M-x only displays functions that are declared (interactive). The interactive version of define-key is global-set-key.

The second one would be because you are defining C-x 1, but then trying to use C-x l. 1 and l haven't been the same character since typewriters went out of style.

share|improve this answer
I was thinking too much about why define-key doesn't work in minibuffer, then completely didn't notice I mistook 1 and l, shame on me ... – zhanwu Mar 5 '11 at 14:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.