unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: chickenphat <chickenphat@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Advice on writing predicates
Date: Mon, 29 Jun 2009 12:18:00 -0700 (PDT)	[thread overview]
Message-ID: <0769d45b-8ac0-4d53-a3eb-6eeb5e0475e7@h18g2000yqj.googlegroups.com> (raw)
In-Reply-To: 87bpobgann.wl%anselm.helbig+news2009@googlemail.com

On Jun 25, 4:23 pm, Anselm Helbig <anselm.helbig
+news2...@googlemail.com> 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	other threads:[~2009-06-29 19:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-25 22:27 Advice on writing predicates Sarir Khamsi
2009-06-25 23:23 ` Anselm Helbig
2009-06-29 19:18   ` chickenphat [this message]
2009-06-26  6:40 ` Daniel Pittman
2009-06-26  7:37 ` Andreas Röhler
2009-06-26  9:13 ` Pascal J. Bourguignon
2009-06-26 11:02 ` Thien-Thi Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0769d45b-8ac0-4d53-a3eb-6eeb5e0475e7@h18g2000yqj.googlegroups.com \
    --to=chickenphat@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).