help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting the operational value of a buffer variable


From: Heime
Subject: Getting the operational value of a buffer variable
Date: Fri, 02 Dec 2022 01:07:07 +0000

I want to get the operational value of a buffer variable.  If the buffer has a 
local value, one 
cannot use the default-value implementation.  And if the local value in nil, I 
have to get the
default-value.

Would like a robust implementation that would not miss anything. 

(defun operational-value (variable)
  "Get the operational value of a buffer variable."

  (cond

   ((equal (buffer-local-value variable) (default-value variable))
      (buffer-local-value variable))

   ((equal (buffer-local-value variable) nil)
      (default-value variable)) ))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]