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?

link|improve this question

feedback

1 Answer

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.

link|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
feedback

Your Answer

 
or
required, but never shown

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