Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set buffer local variable in emacs

Tags:

emacs

I'd like to set a buffer-local variable (specifically mark-ring) to the default value (nil). How can I do this task? Is the only option to create some function and bind it to a key sequence in init.el file?

like image 247
ayvango Avatar asked Aug 26 '13 19:08

ayvango


People also ask

What is EMAC buffer?

Buffers in Emacs editing are objects that have distinct names and hold text that can be edited. Buffers appear to Lisp programs as a special data type. You can think of the contents of a buffer as a string that you can extend; insertions and deletions may occur in any part of the buffer.

What is a buffer variable?

A buffer-local variable has a buffer-local binding associated with a particular buffer. The binding is in effect when that buffer is current; otherwise, it is not in effect. If you set the variable while a buffer-local binding is in effect, the new value goes in that binding, so its other bindings are unchanged.

What does SETQ do in Emacs?

setq does not evaluate symbol ; it sets the symbol that you write. We say that this argument is automatically quoted. The ' q ' in setq stands for “quoted”. The value of the setq form is the value of the last form .

How do I change variables in Emacs?

If they are user options, then M-x customize-option . If they are defvars, not options, then edit the value in the source buffer or in a copy of the defvar in another buffer. Or use M-: (setq THE-VAR "edit the text in the minibuffer) . Save this answer.


1 Answers

M-x eval-expression (setq mark-ring nil) (also M-: (setq mark-ring nil))

like image 108
seanmcl Avatar answered Oct 03 '22 17:10

seanmcl