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

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

Re: How check when symbol is introduced in Emacs?


From: Stefan Monnier
Subject: Re: How check when symbol is introduced in Emacs?
Date: Wed, 19 Jan 2011 10:15:28 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> Usually I get Error with previous Emacs version when symbol is undefined.

> To workaround I use code like:

> (when (or (>= emacs-major-version 23)
>                   (and (= emacs-major-version 22) (>= emacs-minor-version
> 2)))
>    (setq 'symb val)
>   )

Bad idea: rather than worry about which Emacs started to provide this
variable, stick to your real problem, which is to figure out whether
your currently running Emacs provides it.  And that's easy to do:

   (boundp '<symbol>)

will tell you just that.  If you want to test the presence of
a function, you can similarly use (fboundp '<symbol>).
   

        Stefan


reply via email to

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