0

I'm using GNU Emacs 23.3.1. When I press "M-q" emacs says "M-q is undefined". How can I solve this issue? Thanks.

beegii
  • 43
  • 3
  • 5
    `M-q` is normally bound to `fill-paragraph`. Does this happen if you start Emacs without your own init file. In that case you can try to find the culprit by using more and more if it. – Lindydancer Jan 31 '12 at 21:03
  • @Lindydancer: it doesn't help. – beegii Feb 01 '12 at 10:41

2 Answers2

1

Start Emacs with the -Q option, and see if the problem persists by typing C-h k M-q. If it turns out that M-q is in fact bound to fill-paragraph that way, then something in your init file apparently undoes that key binding.

You could then comment out some of your customizations in the .emacs file in a "binary search" style to find which one of them is responsible for removing said key binding.

Thomas
  • 17,016
  • 4
  • 46
  • 70
  • emacs says "M-q runs the command fill-paragraph, which is an interactive compiled Lisp function in `fill.el'. It is bound to M-q. (fill-paragraph &optional JUSTIFY REGION) etc....". But still it does not work. Even after I removed my .emacs file. – beegii Feb 01 '12 at 10:59
  • 1
    @beegii: Just curious, what caused the problem? – Lindydancer Feb 01 '12 at 11:39
  • 1
    @Lindydancer Hey, I just realized that you pretty much already gave the same answer in your very first comment to the OP's question. I think it's unfair that I'm getting the credit for it, so why don't you put it as an answer so beegii can tick it as the correct one? – Thomas Feb 01 '12 at 23:27
  • 1
    @Thomas: Thanks, but as an old-time Emacs user, I'm just glad that the problem was solved. You can enjoy the rep:s without any regrets... – Lindydancer Feb 01 '12 at 23:34
  • @Lindydancer Cheers, mate, then I will sit back now and enjoy the credit... :-) – Thomas Feb 01 '12 at 23:39
  • @Lindydancer: I followed Thomas's guide. So I did a binary search on my .emacs. The problem was on the following four rows: (global-set-key (read-kbd-macro "ESC ") 'my-next-buffer) (global-set-key (read-kbd-macro "ESC ") 'my-prev-buffer) (global-set-key (read-kbd-macro "ESC ") 'windmove-up) (global-set-key (read-kbd-macro "ESC ") 'windmove-down). And I just deleted them and it worked out :). I don't know why they cause the problem. – beegii Feb 03 '12 at 10:48
0

Place this line in your .emacs file and restart emacs.

(global-set-key "\M-q" 'fill-paragraph)
Eric Johnson
  • 696
  • 4
  • 23