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

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

Re: Advice on writing predicates


From: chickenphat
Subject: Re: Advice on writing predicates
Date: Mon, 29 Jun 2009 12:18:00 -0700 (PDT)
User-agent: G2/1.0

On Jun 25, 4:23 pm, Anselm Helbig <anselm.helbig
address@hidden> wrote:
> At Thu, 25 Jun 2009 15:27:19 -0700,
>
> I hope you're not too disappointed, but there's a constant named
> emacs-major-version:
>
>   (> emacs-major-version 22)
>
> This is also extracted from the string in emacs-version, this is how
> the emacs devs did it:
>
>   (defconst emacs-major-version
>     (progn (string-match "^[0-9]+" emacs-version)
>      (string-to-number (match-string 0 emacs-version)))
>     "Major version number of this version of Emacs.
>   This variable first existed in version 19.23.")
>
> If you want to parse the version number yourself, this is how I would
> do it:
>
>   (mapcar 'string-to-number (split-string emacs-version "\\."))
>
> Note that the emacs-version variable just holds the number. This makes
> things a lot easier.

This is exactly what I was looking for...and I'm very happy. Thanks.

Sarir


reply via email to

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