all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Getting the operational value of a buffer variable
@ 2022-12-02  1:07 Heime
  2022-12-02  2:33 ` Emanuel Berg
  2022-12-02  2:52 ` [External] : " Drew Adams
  0 siblings, 2 replies; 5+ messages in thread
From: Heime @ 2022-12-02  1:07 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor


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)) ))



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-12-02 22:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-02  1:07 Getting the operational value of a buffer variable Heime
2022-12-02  2:33 ` Emanuel Berg
2022-12-02  2:52 ` [External] : " Drew Adams
2022-12-02 13:25   ` Heime
2022-12-02 22:00     ` Heime

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.