From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: checking emacs version Date: Mon, 23 Feb 2009 23:36:15 -0500 Organization: A noiseless patient Spider Message-ID: References: <643cd3d3-5a51-41ce-b830-b71f27b59666@h5g2000yqh.googlegroups.com> <0cda7201-96b3-4625-a760-f5548658e968@l16g2000yqo.googlegroups.com> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1235450491 29820 80.91.229.12 (24 Feb 2009 04:41:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 24 Feb 2009 04:41:31 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Feb 24 05:42:47 2009 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.50) id 1Lbp82-0000cE-Nu for geh-help-gnu-emacs@m.gmane.org; Tue, 24 Feb 2009 05:42:46 +0100 Original-Received: from localhost ([127.0.0.1]:47992 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lbp6i-0006Ii-7k for geh-help-gnu-emacs@m.gmane.org; Mon, 23 Feb 2009 23:41:24 -0500 Original-Path: news.stanford.edu!headwall.stanford.edu!news.glorb.com!news.motzarella.org!motzarella.org!news.motzarella.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 44 Original-X-Trace: news.eternal-september.org U2FsdGVkX1+O2vjEKYKroMhjtEBH7Ynk9vtGSNTQ5JZOLkniJj/NyDKtkN/pmtXpC2YyG/VFSibDvEenEqVmkOirT6WrOULwWnce7uJavTMwwgtCt9JIllIwbzWVqqiAA13FvjbjdtU= Original-X-Complaints-To: Please send complaints to abuse@motzarella.org with full headers Original-NNTP-Posting-Date: Tue, 24 Feb 2009 04:36:15 +0000 (UTC) X-Auth-Sender: U2FsdGVkX18r+N/SuXH3jBDCeclzpXrlxU+xb935bqI= Cancel-Lock: sha1:nkvO3m3wpt5T6GtV1A70S/OdVhM= User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Mail-Copies-To: nobody Original-Xref: news.stanford.edu gnu.emacs.help:167006 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:62308 Archived-At: In article <0cda7201-96b3-4625-a760-f5548658e968@l16g2000yqo.googlegroups.com>, Eric wrote: > On Feb 24, 12:07 pm, Eli Zaretskii wrote: > > > From: Eric > > > Date: Mon, 23 Feb 2009 18:59:43 -0800 (PST) > > > > > I'm writing an .emacs file that will need to work under a few > > > different versions of emacs, and wanted to ask what the most reliable > > > method of checking the current emacs version. Is a simple string > > > search in (emacs-version) acceptable, or is there a more robust way of > > > doing it? > > > > You can do as simple as > > > >    (if (>= emacs-major-version 21) > >        (do-something)) > > > > or more sophisticated > > > >    (if (version<= 23.0.98) > >        (do-something-else)) > > > > Is that what you are looking for? > > No, sorry! I totally failed to say what I was actually doing -- not > checking emacs versions but checking emacs ports: I use Carbon Emacs > on my mac at home, and vanilla emacs on my server, and want to set > some Carbon-specific variables when I'm at home. The string "Carbon" > show up in (emacs-version), that's why I was thinking that might be > how I have to do it. Are you sure you need to conditionalize on that, rather than something more generic? E.g. (if (eq window-system 'mac) (do-something)) -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group ***