all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Heime <heimeborgia@protonmail.com>
To: Heime via Users list for the GNU Emacs text editor
	<help-gnu-emacs@gnu.org>
Subject: Getting the operational value of a buffer variable
Date: Fri, 02 Dec 2022 01:07:07 +0000	[thread overview]
Message-ID: <aEkq77_JqzzgeuasOG6d63g1YjyfDzQkSq6h1bS78IQ1AgGWFGRAobFYpcmEyprjHdA0by_fZxN5hseeyUaBkkAyYg6WxsHgcUlDP4n1O34=@protonmail.com> (raw)


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	other threads:[~2022-12-02  1:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-02  1:07 Heime [this message]
2022-12-02  2:33 ` Getting the operational value of a buffer variable Emanuel Berg
2022-12-02  2:52 ` [External] : " Drew Adams
2022-12-02 13:25   ` Heime
2022-12-02 22:00     ` Heime

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='aEkq77_JqzzgeuasOG6d63g1YjyfDzQkSq6h1bS78IQ1AgGWFGRAobFYpcmEyprjHdA0by_fZxN5hseeyUaBkkAyYg6WxsHgcUlDP4n1O34=@protonmail.com' \
    --to=heimeborgia@protonmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.