unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#25590: Remove build number from emacs-version variable
@ 2017-01-31 17:55 Glenn Morris
  2017-02-04 10:15 ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Glenn Morris @ 2017-01-31 17:55 UTC (permalink / raw)
  To: 25590

Package: emacs
Version: 25.1
Severity: wishlist

I'd like to suggest removing the build number from the variable emacs-version.
Instead, it can go in a separate variable (eg emacs-build-number).
The function emacs-version can still include it in parentheses, like it
does for several other quantities.

Motivation:
I think the build number is a largely internal detail that is only of
interest to a small number of developers (as a data point, I've never
used/wanted it for anything). Having it in the version string is
confusing to people not familiar with Emacs development.
(I am not aware of any other software that even has a concept of "build
number".)





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

* bug#25590: Remove build number from emacs-version variable
  2017-01-31 17:55 bug#25590: Remove build number from emacs-version variable Glenn Morris
@ 2017-02-04 10:15 ` Eli Zaretskii
  2017-02-05 23:45   ` Glenn Morris
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2017-02-04 10:15 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 25590

> From: Glenn Morris <rgm@gnu.org>
> Date: Tue, 31 Jan 2017 12:55:58 -0500
> 
> I'd like to suggest removing the build number from the variable emacs-version.
> Instead, it can go in a separate variable (eg emacs-build-number).
> The function emacs-version can still include it in parentheses, like it
> does for several other quantities.

If we do the above, we should make sure version-comparison functions
treat something like "25.2 (build 4)" correctly.

> Motivation:
> I think the build number is a largely internal detail that is only of
> interest to a small number of developers (as a data point, I've never
> used/wanted it for anything). Having it in the version string is
> confusing to people not familiar with Emacs development.

FWIW, I think this is a low-priority issue, as it most probably will
require quite a few changes, while the benefits are minor at best.

> (I am not aware of any other software that even has a concept of "build
> number".)

It's actually part of a version number (which many other projects
have, e.g., GDB just released version 7.12.1), except that we never
release such versions, they exist only on end-users' machines.  Other
than that, there's nothing in it which is special to Emacs.





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

* bug#25590: Remove build number from emacs-version variable
  2017-02-04 10:15 ` Eli Zaretskii
@ 2017-02-05 23:45   ` Glenn Morris
  2017-02-06 15:32     ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Glenn Morris @ 2017-02-05 23:45 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 25590

Eli Zaretskii wrote:

> If we do the above, we should make sure version-comparison functions
> treat something like "25.2 (build 4)" correctly.

I disagree that this is desirable.

>> (I am not aware of any other software that even has a concept of "build
>> number".)
>
> It's actually part of a version number (which many other projects
> have, e.g., GDB just released version 7.12.1), except that we never
> release such versions, they exist only on end-users' machines.  Other
> than that, there's nothing in it which is special to Emacs.

I don't understand the comparison. A micro version number
(major.minor.micro) is not the same thing as Emacs's build number.
This is precisely the confusion that arises with Emacs.





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

* bug#25590: Remove build number from emacs-version variable
  2017-02-05 23:45   ` Glenn Morris
@ 2017-02-06 15:32     ` Eli Zaretskii
  2017-02-06 18:34       ` Noam Postavsky
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2017-02-06 15:32 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 25590

> From: Glenn Morris <rgm@gnu.org>
> Cc: 25590@debbugs.gnu.org
> Date: Sun, 05 Feb 2017 18:45:34 -0500
> 
> Eli Zaretskii wrote:
> 
> > If we do the above, we should make sure version-comparison functions
> > treat something like "25.2 (build 4)" correctly.
> 
> I disagree that this is desirable.

Can you explain why?  My reasoning was that if "25.2.4" is replaced by
"25.2 (build 4)", then Lisp code that compares version (e.g., I have
such code in my .emacs) will not work properly unless the
version-comparison functions are updated to support such values.

> > It's actually part of a version number (which many other projects
> > have, e.g., GDB just released version 7.12.1), except that we never
> > release such versions, they exist only on end-users' machines.  Other
> > than that, there's nothing in it which is special to Emacs.
> 
> I don't understand the comparison. A micro version number
> (major.minor.micro) is not the same thing as Emacs's build number.

I think it is.





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

* bug#25590: Remove build number from emacs-version variable
  2017-02-06 15:32     ` Eli Zaretskii
@ 2017-02-06 18:34       ` Noam Postavsky
  2017-02-06 19:38         ` Eli Zaretskii
  2017-02-07  4:40         ` Glenn Morris
  0 siblings, 2 replies; 9+ messages in thread
From: Noam Postavsky @ 2017-02-06 18:34 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 25590

On Mon, Feb 6, 2017 at 10:32 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Glenn Morris <rgm@gnu.org>
>> Cc: 25590@debbugs.gnu.org
>> Date: Sun, 05 Feb 2017 18:45:34 -0500
>>
>> Eli Zaretskii wrote:
>>
>> > If we do the above, we should make sure version-comparison functions
>> > treat something like "25.2 (build 4)" correctly.
>>
>> I disagree that this is desirable.
>
> Can you explain why?  My reasoning was that if "25.2.4" is replaced by
> "25.2 (build 4)", then Lisp code that compares version (e.g., I have
> such code in my .emacs) will not work properly unless the
> version-comparison functions are updated to support such values.

I think the proposal is to go from this:

emacs-version ;=> "24.5.1"
(emacs-version) ;=> "GNU Emacs 24.5.1 (i686-pc-mingw32)
 of 2015-04-11 on LEG570"

to this

emacs-version ;=> "24.5"
emacs-build-number ;=> 1
(emacs-version) ;=> "GNU Emacs 24.5 (Build 1) (i686-pc-mingw32)
 of 2015-04-11 on LEG570"

i.e., there are no changes in version-comparibility:
 (version< emacs-version "24.5") continues to work,
 (version< (emacs-version) "24.5") continues to fail.

>
>> > It's actually part of a version number (which many other projects
>> > have, e.g., GDB just released version 7.12.1), except that we never
>> > release such versions, they exist only on end-users' machines.  Other
>> > than that, there's nothing in it which is special to Emacs.
>>
>> I don't understand the comparison. A micro version number
>> (major.minor.micro) is not the same thing as Emacs's build number.
>
> I think it is.
>

GDB 7.12.1 is a public release, the official NEWS file documents the
differences between that and 7.12. For Emacs, there is no well-defined
difference between 25.1.1 and 25.1.2, it could be different for every
person who builds it.





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

* bug#25590: Remove build number from emacs-version variable
  2017-02-06 18:34       ` Noam Postavsky
@ 2017-02-06 19:38         ` Eli Zaretskii
  2017-02-06 20:24           ` Noam Postavsky
  2017-02-07  4:40         ` Glenn Morris
  1 sibling, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2017-02-06 19:38 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 25590

> From: Noam Postavsky <npostavs@users.sourceforge.net>
> Date: Mon, 6 Feb 2017 13:34:40 -0500
> Cc: Glenn Morris <rgm@gnu.org>, 25590@debbugs.gnu.org
> 
> I think the proposal is to go from this:
> 
> emacs-version ;=> "24.5.1"
> (emacs-version) ;=> "GNU Emacs 24.5.1 (i686-pc-mingw32)
>  of 2015-04-11 on LEG570"
> 
> to this
> 
> emacs-version ;=> "24.5"
> emacs-build-number ;=> 1
> (emacs-version) ;=> "GNU Emacs 24.5 (Build 1) (i686-pc-mingw32)
>  of 2015-04-11 on LEG570"
> 
> i.e., there are no changes in version-comparibility:
>  (version< emacs-version "24.5") continues to work,
>  (version< (emacs-version) "24.5") continues to fail.

Ah, okay.  Sorry for my confusion.

> >> > It's actually part of a version number (which many other projects
> >> > have, e.g., GDB just released version 7.12.1), except that we never
> >> > release such versions, they exist only on end-users' machines.  Other
> >> > than that, there's nothing in it which is special to Emacs.
> >>
> >> I don't understand the comparison. A micro version number
> >> (major.minor.micro) is not the same thing as Emacs's build number.
> >
> > I think it is.
> >
> 
> GDB 7.12.1 is a public release, the official NEWS file documents the
> differences between that and 7.12. For Emacs, there is no well-defined
> difference between 25.1.1 and 25.1.2, it could be different for every
> person who builds it.

Isn't that what I said above?





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

* bug#25590: Remove build number from emacs-version variable
  2017-02-06 19:38         ` Eli Zaretskii
@ 2017-02-06 20:24           ` Noam Postavsky
  0 siblings, 0 replies; 9+ messages in thread
From: Noam Postavsky @ 2017-02-06 20:24 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 25590

On Mon, Feb 6, 2017 at 2:38 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>> >> > It's actually part of a version number (which many other projects
>> >> > have, e.g., GDB just released version 7.12.1), except that we never
>> >> > release such versions, they exist only on end-users' machines.  Other
>> >> > than that, there's nothing in it which is special to Emacs.
>> >>
>> >> I don't understand the comparison. A micro version number
>> >> (major.minor.micro) is not the same thing as Emacs's build number.
>> >
>> > I think it is.
>> >
>>
>> GDB 7.12.1 is a public release, the official NEWS file documents the
>> differences between that and 7.12. For Emacs, there is no well-defined
>> difference between 25.1.1 and 25.1.2, it could be different for every
>> person who builds it.
>
> Isn't that what I said above?

Hmm, yeah, I suppose so. I guess this seems like such a big difference
in meaning to me that it's a bit absurd to say GDB's micro version is
any sense "the same" as Emacs' build number. As in: they are the same
except that they are completely different.

Putting philosophy aside: the proposal would make the build number
look different from a micro version, which should help stop users
unfamiliar with Emacs development practice getting confused into
thinking that the build number denotes a released version like a micro
version does. I think this is a good idea.





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

* bug#25590: Remove build number from emacs-version variable
  2017-02-06 18:34       ` Noam Postavsky
  2017-02-06 19:38         ` Eli Zaretskii
@ 2017-02-07  4:40         ` Glenn Morris
  2017-02-07  6:23           ` Glenn Morris
  1 sibling, 1 reply; 9+ messages in thread
From: Glenn Morris @ 2017-02-07  4:40 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 25590

Noam Postavsky wrote:

> I think the proposal is to go from this:
>
> emacs-version ;=> "24.5.1"
> (emacs-version) ;=> "GNU Emacs 24.5.1 (i686-pc-mingw32)
>  of 2015-04-11 on LEG570"
>
> to this
>
> emacs-version ;=> "24.5"
> emacs-build-number ;=> 1
> (emacs-version) ;=> "GNU Emacs 24.5 (Build 1) (i686-pc-mingw32)
>  of 2015-04-11 on LEG570"

Exactly, thanks for explaining.

Here's a patch.

Very few places need adjusting. Those that do are all places that are
currently manually discarding the build number as irrelevant.

Note that emacs --version no longer outputs the build number.
I'm wondering if M-x emacs-version can omit the build number too.
I think it unlikely that anyone using M-x emacs-version cares about it.

BTW, I see in elpa.gnu.org that company.el and diff-hl-dired.el
compare emacs-version against strings including build numbers
("24.4.51.5"), which again seems to indicate confusing the build
number for something meaningful.


diff --git i/admin/admin.el w/admin/admin.el
index 4892045..a6ef19c 100644
--- i/admin/admin.el
+++ w/admin/admin.el
@@ -93,9 +93,7 @@ Optional argument DATE is the release date, default today."
 Root must be the root of an Emacs source tree."
   (interactive (list
 		(read-directory-name "Emacs root directory: " source-directory)
-		(read-string "Version number: "
-			     (replace-regexp-in-string "\\.[0-9]+\\'" ""
-						       emacs-version))))
+		(read-string "Version number: " emacs-version)))
   (unless (file-exists-p (expand-file-name "src/emacs.c" root))
     (user-error "%s doesn't seem to be the root of an Emacs source tree" root))
   (message "Setting version numbers...")
diff --git i/doc/lispref/intro.texi w/doc/lispref/intro.texi
index d871d3a..d617044 100644
--- i/doc/lispref/intro.texi
+++ w/doc/lispref/intro.texi
@@ -480,8 +480,8 @@ running.  It is useful to include this string in bug reports.
 @smallexample
 @group
 (emacs-version)
-  @result{} "GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16)
-             of 2015-06-01"
+  @result{} "GNU Emacs 26.1 (build 1, x86_64-unknown-linux-gnu,
+             GTK+ Version 3.16) of 2015-06-01"
 @end group
 @end smallexample
 
@@ -507,11 +507,11 @@ emacs-build-time
 
 @defvar emacs-version
 The value of this variable is the version of Emacs being run.  It is a
-string such as @code{"23.1.1"}.  The last number in this string is not
-really part of the Emacs release version number; it is incremented
-each time Emacs is built in any given directory.  A value with four
-numeric components, such as @code{"22.0.91.1"}, indicates an
-unreleased test version.
+string such as @code{"26.1"}.  A value with three numeric components,
+such as @code{"26.0.91"}, indicates an unreleased test version.
+(Prior to Emacs 26.1, the string includes an extra final component
+with the integer that is now stored in @code{emacs-build-number};
+e.g., @code{"25.1.1"}.)
 @end defvar
 
 @defvar emacs-major-version
@@ -524,6 +524,12 @@ The minor version number of Emacs, as an integer.  For Emacs version
 23.1, the value is 1.
 @end defvar
 
+@defvar emacs-build-number
+An integer that increments each time Emacs is built in the same
+directory (without cleaning).  This is only of relevance when
+developing Emacs.
+@end defvar
+
 @node Acknowledgments
 @section Acknowledgments
 
diff --git i/etc/NEWS w/etc/NEWS
index 4d8ae09..92c4fe8 100644
--- i/etc/NEWS
+++ w/etc/NEWS
@@ -80,6 +80,9 @@ for '--daemon'.
 \f
 * Changes in Emacs 26.1
 
+** The variable 'emacs-version' no longer includes the build number.
+This is now stored separately in a new variable, 'emacs-build-number'.
+
 +++
 ** The new function 'mapbacktrace' applies a function to all frames of
 the current stack trace.
diff --git i/lisp/gnus/gnus-util.el w/lisp/gnus/gnus-util.el
index ff5c295..20eceb5 100644
--- i/lisp/gnus/gnus-util.el
+++ w/lisp/gnus/gnus-util.el
@@ -1618,7 +1618,7 @@ sequence, this is like `mapcar'.  With several, it is like the Common Lisp
      ((not (memq 'emacs lst))
       nil)
      ((string-match "^\\(\\([.0-9]+\\)*\\)\\.[0-9]+$" emacs-version)
-      (concat "Emacs/" (match-string 1 emacs-version)
+      (concat "Emacs/" emacs-version
 	      (if system-v
 		  (concat " (" system-v ")")
 		"")))
diff --git i/lisp/loadup.el w/lisp/loadup.el
index ecb7284..5b19b05 100644
--- i/lisp/loadup.el
+++ w/lisp/loadup.el
@@ -350,7 +350,7 @@ lost after dumping")))
 	 (multibyte-string-p default-directory))
     (error "default-directory must be unibyte when dumping Emacs!"))
 
-;; Determine which last version number to use
+;; Determine which build number to use
 ;; based on the executables that now exist.
 (if (and (equal (last command-line-args) '("dump"))
 	 (not (eq system-type 'ms-dos)))
@@ -364,10 +364,9 @@ lost after dumping")))
 			     files)))
       (setq emacs-repository-version (condition-case nil (emacs-repository-get-version)
                               (error nil)))
-      ;; `emacs-version' is a constant, so we shouldn't change it with `setq'.
-      (defconst emacs-version
-	(format "%s.%d"
-		emacs-version (if versions (1+ (apply 'max versions)) 1)))))
+      ;; A constant, so we shouldn't change it with `setq'.
+      (defconst emacs-build-number
+	(if versions (1+ (apply 'max versions)) 1))))
 
 
 (message "Finding pointers to doc strings...")
@@ -463,7 +462,7 @@ lost after dumping")))
                    ;; Don't bother adding another name if we're just
                    ;; building bootstrap-emacs.
                    (equal (last command-line-args) '("bootstrap"))))
-	  (let ((name (concat "emacs-" emacs-version))
+	  (let ((name (format "emacs-%s.%d" emacs-version emacs-build-number))
 		(exe (if (eq system-type 'windows-nt) ".exe" "")))
 	    (while (string-match "[^-+_.a-zA-Z0-9]+" name)
 	      (setq name (concat (downcase (substring name 0 (match-beginning 0)))
diff --git i/lisp/mail/emacsbug.el w/lisp/mail/emacsbug.el
index c8214c3..ecb7db6 100644
--- i/lisp/mail/emacsbug.el
+++ w/lisp/mail/emacsbug.el
@@ -151,10 +151,7 @@ Prompts for bug subject.  Leaves you in a mail buffer."
   (interactive "sBug Subject: ")
   ;; The syntax `version;' is preferred to `[version]' because the
   ;; latter could be mistakenly stripped by mailing software.
-  (if (eq system-type 'ms-dos)
-      (setq topic (concat emacs-version "; " topic))
-    (when (string-match "^\\(\\([.0-9]+\\)*\\)\\.[0-9]+$" emacs-version)
-      (setq topic (concat (match-string 1 emacs-version) "; " topic))))
+  (setq topic (concat emacs-version "; " topic))
   (let ((from-buffer (current-buffer))
 	(can-insert-mail (or (report-emacs-bug-can-use-xdg-email)
 			     (report-emacs-bug-can-use-osx-open)))
diff --git i/lisp/version.el w/lisp/version.el
index 99ab351..ea6f1b4 100644
--- i/lisp/version.el
+++ w/lisp/version.el
@@ -44,6 +44,12 @@ This variable first existed in version 19.23.")
 (defconst emacs-build-time (if emacs-build-system (current-time))
   "Time at which Emacs was dumped out, or nil if not available.")
 
+(defconst emacs-build-number 1          ; loadup.el may increment this
+  "The build number of this version of Emacs.
+This is an integer that increments each time Emacs is built in a given
+directory (without cleaning).  This is likely to only be relevant when
+developing Emacs.")
+
 (defvar motif-version-string)
 (defvar gtk-version-string)
 (defvar ns-version-string)
@@ -56,8 +62,9 @@ Don't use this function in programs to choose actions according
 to the system configuration; look at `system-configuration' instead."
   (interactive "P")
   (let ((version-string
-         (format "GNU Emacs %s (%s%s%s%s)%s"
+         (format "GNU Emacs %s (build %s, %s%s%s%s)%s"
                  emacs-version
+                 emacs-build-number
 		 system-configuration
 		 (cond ((featurep 'motif)
 			(concat ", " (substring motif-version-string 4)))
diff --git i/src/emacs.c w/src/emacs.c
index 3083d0d..e5305e2 100644
--- i/src/emacs.c
+++ w/src/emacs.c
@@ -2607,7 +2607,12 @@ Anything else (in Emacs 26, the possibilities are: aix, berkeley-unix,
   Vemacs_copyright = build_string (emacs_copyright);
 
   DEFVAR_LISP ("emacs-version", Vemacs_version,
-	       doc: /* Version numbers of this version of Emacs.  */);
+	       doc: /* Version numbers of this version of Emacs.
+This has the form: MAJOR.MINOR[.MICRO], where MAJOR/MINOR/MICRO are integers.
+MICRO is only present in unreleased development versions,
+and is not especially meaningful.  Prior to Emacs 26.1, an extra final
+component .BUILD is present.  This is now stored separately in
+`emacs-build-number'.  */);
   Vemacs_version = build_string (emacs_version);
 
   DEFVAR_LISP ("report-emacs-bug-address", Vreport_emacs_bug_address,





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

* bug#25590: Remove build number from emacs-version variable
  2017-02-07  4:40         ` Glenn Morris
@ 2017-02-07  6:23           ` Glenn Morris
  0 siblings, 0 replies; 9+ messages in thread
From: Glenn Morris @ 2017-02-07  6:23 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 25590


I forgot to include the elpa piece.

--- i/packages/debbugs/debbugs-gnu.el
+++ w/packages/debbugs/debbugs-gnu.el
@@ -1,6 +1,6 @@
 ;;; debbugs-gnu.el --- interface for the GNU bug tracker  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2011-2016 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2017 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;;         Michael Albinus <michael.albinus@gmx.org>
@@ -1501,14 +1501,20 @@ removed instead."
 	     "Version: "
 	     (cond
 	      ;; Emacs development versions.
-	      ((string-match
-		"^\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)\\." emacs-version)
+	      ((if (boundp 'emacs-build-number)
+		   (string-match
+		    "^\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)" emacs-version)
+		 (string-match
+		  "^\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)\\." emacs-version))
 	       (format "%s.%d"
 		       (match-string 1 emacs-version)
 		       (1+ (string-to-number (match-string 2 emacs-version)))))
 	      ;; Emacs release versions.
-	      ((string-match
-		"^\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)$" emacs-version)
+	      ((if (boundp 'emacs-build-number)
+		   (string-match
+		    "^\\([0-9]+\\)\\.\\([0-9]+\\)$" emacs-version)
+		 (string-match
+		  "^\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)$" emacs-version))
 	       (format "%s.%s"
 		       (match-string 1 emacs-version)
 		       (match-string 2 emacs-version)))





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

end of thread, other threads:[~2017-02-07  6:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-31 17:55 bug#25590: Remove build number from emacs-version variable Glenn Morris
2017-02-04 10:15 ` Eli Zaretskii
2017-02-05 23:45   ` Glenn Morris
2017-02-06 15:32     ` Eli Zaretskii
2017-02-06 18:34       ` Noam Postavsky
2017-02-06 19:38         ` Eli Zaretskii
2017-02-06 20:24           ` Noam Postavsky
2017-02-07  4:40         ` Glenn Morris
2017-02-07  6:23           ` Glenn Morris

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