[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: global-set-key not global?
From: |
Stefan Monnier |
Subject: |
Re: global-set-key not global? |
Date: |
Thu, 05 Feb 2004 19:35:46 GMT |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
> im using the following in my .emacs:
> (global-set-key "\C-j" 'bs-cycle-next)
> (global-set-key "\M-j" 'bs-cycle-previous)
> but a number of major modes still seem to have C-j bound to insert-newline.
> it works fine if i use local-set-key inside the add-hook for every mode, but
> seems like i shouldnt have to do this.
Indeed. Report those things as bugs.
> also, how can i use the semicolon in a keybinding. obviously, the following
> doesnt work:
> (global-set-key "\C-;" 'indent-for-comment)
Indeed, because C-; is not a character (contrary to C-a and a few other
such special cases) so you can't put it in a string.
Instead use the form [(control ?\;)].
> how can i escape the ";" character so that it doesnt look like a comment
> to elisp?
In your code above it should work just fine since it's inside a string.
When it's not inside a string use \ as I did above.
Stefan