[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why different behaviour of concat on OSX and on Lubuntu
From: |
Michael Heerdegen |
Subject: |
Re: Why different behaviour of concat on OSX and on Lubuntu |
Date: |
Tue, 28 May 2013 22:34:04 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
Guido Van Hoecke <guivho@gmail.com> writes:
> Part of the code looks like this:
> ;; check whether running on OSX
> (setq isOSX (equal (expand-file-name "~/") "/Users/guivho/"))
>
> (if isOSX
> (setq leader "§")
> (setq leader "²"))
>
> (global-set-key (kbd (concat "M-" leader)) 'overwrite-mode)
>
> The last statement maps overwrite-mode to the M-§ sequence on my iMac.
>
> On the Lubuntu machine, it does not map M-² to overwrite-mode, It barks:
>
> (wrong-type-argument integer-or-marker-p (concat "M-" leader))
> read-kbd-macro((concat "M-" leader)
> [...]
> I am puzzled why the concat does not work on lubuntu, and would like
> to know how to code it to achieve the desired effect.
`kbd' was a (quite strange) macro in Emacs 23. It changed to a function
in Emacs 24. Your code works only in the last case. Call it a bug in
Emacs 23.
As long as you need to use both Emacs versions in parallel, you should
be safe when you use `read-kbd-macro' instead of `kbd'. It does the
same, but should work in both versions.
Regards,
Michael.