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?
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.
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.
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 .
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.
M-x eval-expression (setq mark-ring nil)
(also M-: (setq mark-ring nil)
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With