[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
<0cda7201-96b3-4625-a760-f5548658e968@l16g2000yqo.googlegroups.com>,
Eric <girzel@gmail.com> wrote:
> On Feb 24, 12:07 pm, Eli Zaretskii <e...@gnu.org> wrote:
> > > From: Eric <gir...@gmail.com>
> > > 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 ***
Re: checking emacs version, Leo, 2009/02/24
Message not available
Re: checking emacs version, Pascal J. Bourguignon, 2009/02/24