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

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

Re: checking emacs version


From: Barry Margolin
Subject: Re: checking emacs version
Date: Mon, 23 Feb 2009 23:36:15 -0500
User-agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X)

In article 
<address@hidden>,
 Eric <address@hidden> wrote:

> On Feb 24, 12:07 pm, Eli Zaretskii <address@hidden> wrote:
> > > From: Eric <address@hidden>
> > > 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, address@hidden
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 ***


reply via email to

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