views:

75

answers:

3

I am getting an error in my .emacs file at the following line:

(switch-to-buffer *Completions*)

error: symbols value as variable is void

I did a describe-function on switch-to-buffer and found I CAN pass it a BUFFER (and another optional argument which I do not currently need). What am I doing wrong?

Just a few notes:
a. I also need two similar lines (switch-to-buffer *grep*) and (switch-to-buffer *compilation*) so the simple solution of using (switch-to-completions) won't solve all of my problems.
b. All of the buffers I require are already open, so I don't think that is the problem.

+3  A: 

You can specify a buffer name, as such:


(switch-to-buffer "*Help*")

From the docs:

Select buffer BUFFER in the current window. BUFFER may be a buffer or a buffer name.
Dewayne Christensen
+4  A: 

Try

(switch-to-buffer "*Completions*")
Francis Upton
Thanks to both of you. Works perfectly.
Toddeman
A: 

The implication of what Dewayne said is that you can pass objects returned from things like (buffer-list) to functions, if you're trying to do things programmatically, and don't particularly want to deal with strings as an intermediary.

quodlibetor