unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [Suggestion] New function `emacs-version>='
@ 2003-05-02 19:55 Wedler, Christoph
  2003-05-02 21:00 ` Juanma Barranquero
                   ` (3 more replies)
  0 siblings, 4 replies; 27+ messages in thread
From: Wedler, Christoph @ 2003-05-02 19:55 UTC (permalink / raw)


I would like to see the following function defined in Emacs[1]:

(defun emacs-version>= (major &optional minor patch)
  "Return true if the Emacs version is >= to the given version.
The version is provided by the required argument MAJOR, and the optional
arguments MINOR and PATCH.  Only the non-nil arguments are used in the
test."
  (cond ((> emacs-major-version major))
	((< emacs-major-version major) nil)
	((null minor))
	((> emacs-minor-version minor))
	((< emacs-minor-version minor) nil)
	((null patch))
	((string-match "^[0-9]+\\.[0-9]+\\.\\([0-9]+\\)" emacs-version)
	 (>= (string-to-int (match-string 1 emacs-version)) patch)))))

(Of course, a constant `emacs-patch-version' could be defined, as well.
The function above would be changed to use it.)

Specific features or bug fixes are only available in newer Emacsen and
packages must be able to cope with it.

A test like `fboundp' is only the right test iff the new feature to test
for availibility is a function, it is not the right test for

 - I need to check the availibility for feature/fix A
 - feature/fix A is provided with Emacs-X.Y
 - function F is new with Emacs-X.Y
 - therefore I test with (fboundp 'F)

The right test is

 - I need to check the availibility for feature/fix A
 - feature/fix A is provided with Emacs-X.Y
 - therefore I test with (emacs-version>= X Y)

Like it or not, a test like `emacs-version>=' would be useful for many
packages, thus a corresponding function would be useful to define in
Emacs.

- Christoph

[1] This function is already defined in XEmacs.

^ permalink raw reply	[flat|nested] 27+ messages in thread
* RE: [Suggestion] New function `emacs-version>='
@ 2003-05-06 11:10 Wedler, Christoph
  2003-05-06 21:45 ` Luc Teirlinck
  2003-05-07 11:51 ` Richard Stallman
  0 siblings, 2 replies; 27+ messages in thread
From: Wedler, Christoph @ 2003-05-06 11:10 UTC (permalink / raw)
  Cc: emacs-devel

Luc Teirlinck wrote:
 > Christoph Wedler wrote:

 >    (a constant `emacs-patch-level' would be useful then)

 > What would that constant represent?

Well, some emacs-minor-minor-version ;-)  I don't know the current Emacs
version numering scheme.

I thought it would be the 3rd number in `emacs-version' because the
Emacs-21.3 pre-releases had a useful numering scheme, i.e., they had
versions 21.2.90, 21.2.91, ...

Since there might be some bug-fix releases of Emacs-21.3 before
Emacs-21.4 is out, I would think it would be useful to have versions
numbers 21.3.0, 21.3.1 etc for them.  How do I distinguish between such
Emacs-21.3 versions now?  Or is the first bug fix of Emacs-21.3 called
Emacs-21.4 (and the second Emacs-21.5)?

I would also have guessed something similar for the Emacs development
version... (e.g., that they start with Emacs-21.3.40 or whatever...)

 > From the code of emacs-version>= you proposed, it would seem that it
 > would be say the "2" in emacs-21.3.2, representing the second
 > instance of 21.3 the user built in the given directory, or the "50",
 > in emacs-21.3.50.43 (or whatever).  If so, patch-level 50 for
 > emacs-21.3 could represent the 50th time that a "compulsive Emacs
 > builder" built Emacs-21.3 or it could represent a snapshot of
 > emacs-21.3.50.

Err, obviously, Emacs has a different the numering scheme...

 > That would not seem to make a whole lot of sense.

Indeed, but it could make sense if adopted to the Emacs version numering
scheme (which might need to be defined).

- Christoph

^ permalink raw reply	[flat|nested] 27+ messages in thread
* RE: [Suggestion] New function `emacs-version>='
@ 2003-05-07 12:11 Wedler, Christoph
  2003-05-07 12:46 ` Luc Teirlinck
  2003-05-09 11:19 ` Richard Stallman
  0 siblings, 2 replies; 27+ messages in thread
From: Wedler, Christoph @ 2003-05-07 12:11 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman:
 > We have no need for minor-minor versions.  Whenever we make
 > a release, we increment at least the minor version number.

OK.  Remaining questions:

 - What's the official way to distinguish Emacs-21.2 from the Emacs-21.3
   pre-releases (Emacs-21.2.9x)?

 - What's the official way to distinguish Emacs-21.3 from the current
   development versions (Emacs-21.3.50.X)?

- Christoph

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2003-05-09 11:19 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-02 19:55 [Suggestion] New function `emacs-version>=' Wedler, Christoph
2003-05-02 21:00 ` Juanma Barranquero
2003-05-02 21:14   ` Stefan Monnier
2003-05-02 21:35     ` Juanma Barranquero
2003-05-03 11:12       ` Ehud Karni
2003-05-03 13:54         ` Juanma Barranquero
2003-05-03 16:08           ` Stephen J. Turnbull
2003-05-04 19:15             ` Juanma Barranquero
2003-05-06 11:05               ` Stephen J. Turnbull
2003-05-04 13:04           ` Richard Stallman
2003-05-03 17:48     ` Reiner Steib
2003-05-03 18:42       ` Stefan Monnier
2003-05-05 13:47         ` sort-coding-systems in 21.3 and RC branch (was: New function `emacs-version>=') Reiner Steib
2003-05-06  7:08           ` Kenichi Handa
2003-05-02 21:16 ` [Suggestion] New function `emacs-version>=' Thien-Thi Nguyen
2003-05-04 13:03 ` Richard Stallman
2003-05-05 12:52   ` Wedler, Christoph
2003-05-05 13:20     ` Juanma Barranquero
2003-05-05 19:11     ` Richard Stallman
2003-05-05 21:59     ` Luc Teirlinck
2003-05-06 23:42 ` Istvan Marko
  -- strict thread matches above, loose matches on Subject: below --
2003-05-06 11:10 Wedler, Christoph
2003-05-06 21:45 ` Luc Teirlinck
2003-05-07 11:51 ` Richard Stallman
2003-05-07 12:11 Wedler, Christoph
2003-05-07 12:46 ` Luc Teirlinck
2003-05-09 11:19 ` Richard Stallman

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