all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: How check when symbol is introduced in Emacs?
Date: Wed, 19 Jan 2011 10:15:28 -0500	[thread overview]
Message-ID: <jwv62tl0vwt.fsf-monnier+gnu.emacs.help@gnu.org> (raw)
In-Reply-To: mailman.4.1295432653.6673.help-gnu-emacs@gnu.org

> 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	other threads:[~2011-01-19 15:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.4.1295432653.6673.help-gnu-emacs@gnu.org>
2011-01-19 15:15 ` Stefan Monnier [this message]
2011-01-19 10:23 How check when symbol is introduced in Emacs? Oleksandr Gavenko
2011-01-19 14:16 ` suvayu ali
2011-01-19 15:19 ` Eli Zaretskii
2011-01-19 16:02   ` Oleksandr Gavenko

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=jwv62tl0vwt.fsf-monnier+gnu.emacs.help@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --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.