unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Checking in Lisp if a given symbol has its original value
@ 2020-03-31  8:14 Bruno Félix Rezende Ribeiro
  2020-03-31 15:36 ` Drew Adams
  0 siblings, 1 reply; 2+ messages in thread
From: Bruno Félix Rezende Ribeiro @ 2020-03-31  8:14 UTC (permalink / raw)
  To: help-gnu-emacs

What’s the canonical way of checking if a given symbol has its
original value, as reported by ‘describe-variable’?

I’ve come up with:

#+BEGIN_SRC elisp
  (defun standard-value-p (symbol)
    "Return non-nil if SYMBOL has its original value."
      (equal (eval (car (get symbol 'standard-value)))
             symbol))
#+END_SRC

-- 
Bruno Félix Rezende Ribeiro (oitofelix) [0x28D618AF]
<http://oitofelix.freeshell.org/>



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

end of thread, other threads:[~2020-03-31 15:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-31  8:14 Checking in Lisp if a given symbol has its original value Bruno Félix Rezende Ribeiro
2020-03-31 15:36 ` Drew Adams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).