[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: global-set-key, error: Invalid modifier in string
From: |
Stefan Monnier |
Subject: |
Re: global-set-key, error: Invalid modifier in string |
Date: |
Mon, 20 Aug 2007 02:12:02 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) |
> I have this macro at the top of my ~/.emacs so that I don't have to
> think about this mess anymore:
> (defmacro global-defkey (key def)
> "*Bind KEY globally to DEF.
> KEY should be a string constant in the format used for
> saving keyboard macros (cf. `insert-kbd-macro')."
> `(global-set-key (kbd ,key) ,def))
> Use it as in:
> (global-defkey "C-M-<backspace>" 'backward-kill-sexp)
I prefer to solve this issue by saying that key combos are not characters and
hence key sequences are not strings.
So I recommend to use the array notation instead, which also happens to be
the "native" notation.
Stefan
Message not available