[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Problem understanding set-register syntax
From: |
Drew Adams |
Subject: |
RE: Problem understanding set-register syntax |
Date: |
Mon, 6 Dec 2010 14:54:46 -0800 |
> > Why can't I just use:
> > (set-register i '(file . "~/.emacs.d/init.el"))
> > ; will say Symbol's value as variable is void:i
>
> Because the first argument to `set-register' is a register
> name, which is a character, and `?i' is the Lisp syntax for
> the character `i'.
I should also have mentioned that using just i, without quoting it (i.e., 'i)
causes the symbol i to be evaluated. And since the symbol i has no value here
(no global value) you get the error message saying that its value is void.
Some symbols, such as t and nil (and all keywords, such as :foobar) are
self-evaluating, meaning that they act just like variables whose values are the
symbols themselves. You do not need to quote self-evaluating symbols in an
evaluation context. Other symbols (e.g. i, foobar) you do need to quote, if you
want not the value of the symbol (e.g. it might not have a value) but the symbol
itself.
But all characters are self-evaluating, so ?i evaluates to ?i.
See the Emacs manual, node `Init Syntax'.
See the Elisp manual, node `Basic Char Syntax'.
(Use `g' in Info to go to a particular node.)