Function: buffer-local-set-state

buffer-local-set-state is a macro defined in compat-29.el.

Signature

(buffer-local-set-state [VARIABLE VALUE]...)

Documentation

[Compatibility macro for buffer-local-set-state, defined in Emacs 29.1. See
(compat) Emacs 29.1' for more details.]

Like setq-local, but allow restoring the previous state of locals later. This macro returns an object that can be passed to buffer-local-restore-state in order to restore the state of the local variables set via this macro.

Source Code

;; Defined in ~/.emacs.d/elpa/compat-30.1.0.1/compat-29.el
(compat-defmacro buffer-local-set-state (&rest pairs) ;; <compat-tests:buffer-local-set-state>
  "Like `setq-local', but allow restoring the previous state of locals later.
This macro returns an object that can be passed to `buffer-local-restore-state'
in order to restore the state of the local variables set via this macro.

\(fn [VARIABLE VALUE]...)"
  (declare (debug setq))
  (unless (zerop (mod (length pairs) 2))
    (error "PAIRS must have an even number of variable/value members"))
  `(prog1
       (buffer-local-set-state--get ',pairs)
     (,(if (fboundp 'compat--setq-local) 'compat--setq-local 'setq-local)
      ,@pairs)))