unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Stephen J. Turnbull" <stephen@xemacs.org>
To: Jambunathan K <kjambunathan@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: How to fix Emacs24 compiler warning w/o breaking code for previous versions
Date: Fri, 17 Jun 2011 15:34:27 +0900	[thread overview]
Message-ID: <8762o5klu4.fsf@uwakimon.sk.tsukuba.ac.jp> (raw)
In-Reply-To: <811uytyvgc.fsf@gmail.com>

Jambunathan K writes:

 > I was hoping that there is an elisp equivalent for C-like
 > 
 > #if emacs-version > a

First, I don't think this is generally a very good idea.  I prefer
actual feature tests where new features matter, and let the byte
compiler warnings fall where they may in older versions.  That said:

XEmacs has `emacs-version>=', although my local Emacs (21.2.1) doesn't
seem to (not with any spelling starting with "emacs-version", anyway).
I didn't write it and offhand don't know who did, so I can't
contribute it, but it's not hard to write.  You just have to take care
to handle the lexicographic comparison correctly (eg, w.r.t. null
arguments, which is why actually having it is useful vs. homebrew --
homebrew functions often got that wrong).

If you want to check XEmacs compatibility, I'll be happy to compare
anyone's version to the XEmacs algorithm (to avoid legal issues, the
programmer shouldn't do it himself of course).

We don't have `emacs-version=' or `emacs-version>'.  I don't think
they're very useful, though, compared to the ">=" variety.  Nor has
anybody asked for them or tried to contribute them that I can recall.

Here's our doctring:

`emacs-version>=' is a compiled Lisp function
  -- loaded from "/playpen/src/XEmacs/xemacs/lisp/version.elc"
(emacs-version>= MAJOR &optional MINOR PATCH)

Documentation:
Return true if the Emacs version is >= to the given MAJOR, MINOR,
   and PATCH numbers.
The MAJOR version number argument is required, but the other arguments
are optional. Only the Non-nil arguments are used in the test.




  reply	other threads:[~2011-06-17  6:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-16 17:44 How to fix Emacs24 compiler warning w/o breaking code for previous versions Eric Schulte
2011-06-17  3:10 ` Stefan Monnier
2011-06-17  3:42   ` Jambunathan K
2011-06-17  6:34     ` Stephen J. Turnbull [this message]
2011-06-17  7:17       ` Eli Zaretskii
2011-06-19 21:14     ` Daniel Colascione
2011-06-20  7:53     ` David Kastrup
2011-06-17  4:45   ` Eric Schulte
2011-06-17  7:19 ` David Engster

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=8762o5klu4.fsf@uwakimon.sk.tsukuba.ac.jp \
    --to=stephen@xemacs.org \
    --cc=emacs-devel@gnu.org \
    --cc=kjambunathan@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).