emacs-devel
[Top][All Lists]
Advanced

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

Re: How to fix Emacs24 compiler warning w/o breaking code for previous v


From: Stephen J. Turnbull
Subject: Re: How to fix Emacs24 compiler warning w/o breaking code for previous versions
Date: Fri, 17 Jun 2011 15:34:27 +0900

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 via email to

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