From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: How check when symbol is introduced in Emacs? Date: Wed, 19 Jan 2011 10:15:28 -0500 Organization: A noiseless patient Spider Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1295451655 30878 80.91.229.12 (19 Jan 2011 15:40:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 19 Jan 2011 15:40:55 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 19 16:40:51 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Pfa9S-0004rp-HI for geh-help-gnu-emacs@m.gmane.org; Wed, 19 Jan 2011 16:40:50 +0100 Original-Received: from localhost ([127.0.0.1]:43260 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pfa9R-0001OM-Rz for geh-help-gnu-emacs@m.gmane.org; Wed, 19 Jan 2011 10:40:49 -0500 Original-Path: usenet.stanford.edu!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 21 Injection-Info: mx02.eternal-september.org; posting-host="4IZ3yIHoQdnGHfrgR3wu6A"; logging-data="28030"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ljtu9Iu22XLc3RFhnbPSy" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:mesetiLbewI5LCVCp/IXPeFfCEE= sha1:5KweS2qkh0VggqTtqTUX3iT3ubw= Original-Xref: usenet.stanford.edu gnu.emacs.help:184420 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:78588 Archived-At: > 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 ') will tell you just that. If you want to test the presence of a function, you can similarly use (fboundp '). Stefan