Kshitiz Sharma
Kshitiz Sharma

Reputation: 18627

Cannot set variable value in emacs?

I want to change the value of shell-command-default-error-buffer variable in emacs.

First i view the variable to see its present value -

C-h v RET
shell-command-default-error-buffer

The output is -

shell-command-default-error-buffer is a variable defined in `simple.el'.
Its value is nil

Then I try to set the value -

M-x set-variable RET
shell-command-default-error-buffer

It shows me error - [No match]

Why is this?

Upvotes: 4

Views: 1289

Answers (1)

Drew
Drew

Reputation: 30718

You want to use this:

M-: (setq shell-command-default-error-buffer THE-VALUE-YOU-WANT)

If the variable were a user option, then you could also do this, instead:

M-x set-variable RET shell-command-default-error-buffer RET THE-VALUE-YOU-WANT

You had a space between set and variable in what you tried. But that just had the effect of completing set to set-, and when you typed variable you got the same thing as the second above.

The problem was that shell-command-default-error-buffer is not a user option, so command set-variable does not recognize it as a variable that it can set.

Upvotes: 3

Related Questions