I'm trying to rebind the window selection with this in the dotspacemacs/user-config :

(global-set-key (kbd "&") ’select-window-0)

But at startup I got this error message :

(Spacemacs) Error in dotspacemacs/user-config: Symbol's value as variable is void: ’select-window-0

And & is still unset.


I love this one. You have a curly quote instead of a straight apostrophe character. And the former is considered part of the symbol name (’select-window-0), so Emacs is trying to evaluate that symbol (’select-window-0) as a variable.

This what you want:

(global-set-key (kbd "&") 'select-window-0)

You need to use an ASCII apostrophe. The character you used () is named RIGHT SINGLE QUOTATION MARK (in Unicode). The character you want (') is named APOSTROPHE (in Unicode).

  • I've seen this happen as a consequence of code being copied and pasted from web sites. Something along the way (perhaps a so-called WYSIWYG editor for web site content entry) "helpfully" converts apostrophes into curly quotes, and the original author never realises because it never occurs to them to copy and paste their own code back from the web site for testing.
    – phils
    Aug 24 '16 at 3:14
  • how do I do an apostrophe with an azerty keyboard ? I can only do : ", ' and `
    – Unimor
    Aug 24 '16 at 5:06
  • You say: I can only do : ", ' and `. Normally, the third of those, ', should be an apostrophe, whether you have a qwerty or an azerty keyboard. Try typing the expression. I suspect that you instead copied and pasted it from somewhere, and that's how you got the curly quotation mark. See also the comment by @phils.
    – Drew
    Aug 24 '16 at 13:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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