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

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

Re: checking emacs version


From: Eric
Subject: Re: checking emacs version
Date: Mon, 23 Feb 2009 21:19:12 -0800 (PST)
User-agent: G2/1.0

On Feb 24, 12:36 pm, Barry Margolin <address@hidden> wrote:
> 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 ***

I'm not sure at all, and that's why I was asking! This is helpful,
I'll take a look at this and see what's more appropriate to use. I
think there are some variables that are specific to Carbon (ie the
name actually starts with carbon), but window system might be better
for more general stuff.

Thanks a lot!
Eric


reply via email to

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