all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* how to get default value of variable?
@ 2004-09-17 19:09 Miguel Frasson
  2004-09-17 19:24 ` Miguel Frasson
  0 siblings, 1 reply; 2+ messages in thread
From: Miguel Frasson @ 2004-09-17 19:09 UTC (permalink / raw)



Hi

How to get default value of variable?

(setq a 1)  ==> 1
(set (make-local-variable 'a) 2)  ==> 2
a   ==> 2

How to get the default value, in a easy way? I could do

(with-temp-buffer a)   ==> 1

but I like a more "clean" or efficient way to do it. Any hints?

Miguel.

-- 
Miguel Vinicius Santini Frasson
http://www.math.leidenuniv.nl/~frasson

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

* Re: how to get default value of variable?
  2004-09-17 19:09 how to get default value of variable? Miguel Frasson
@ 2004-09-17 19:24 ` Miguel Frasson
  0 siblings, 0 replies; 2+ messages in thread
From: Miguel Frasson @ 2004-09-17 19:24 UTC (permalink / raw)


Miguel Frasson <frasson@acrab.math.leidenuniv.nl> writes:

> Hi
> 
> How to get default value of variable?
> 
> (setq a 1)  ==> 1
> (set (make-local-variable 'a) 2)  ==> 2
> a   ==> 2
> 
> How to get the default value, in a easy way? I could do
> 
> (with-temp-buffer a)   ==> 1

Sorry, the solution was obvious... I don't know how I could not find
before...

(default-value 'a)

Miguel

-- 
Miguel Vinicius Santini Frasson
http://www.math.leidenuniv.nl/~frasson

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

end of thread, other threads:[~2004-09-17 19:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-17 19:09 how to get default value of variable? Miguel Frasson
2004-09-17 19:24 ` Miguel Frasson

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.