From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#25590: Remove build number from emacs-version variable Date: Mon, 06 Feb 2017 23:40:07 -0500 Message-ID: References: <1svasvru4x.fsf@fencepost.gnu.org> <83r33e8doa.fsf@gnu.org> <83k29372t6.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1486442492 23231 195.159.176.226 (7 Feb 2017 04:41:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 7 Feb 2017 04:41:32 +0000 (UTC) User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) Cc: 25590@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 07 05:41:09 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1caxaT-0005OW-B8 for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Feb 2017 05:41:05 +0100 Original-Received: from localhost ([::1]:51976 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1caxaY-0005wW-O4 for geb-bug-gnu-emacs@m.gmane.org; Mon, 06 Feb 2017 23:41:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1caxaR-0005wK-HM for bug-gnu-emacs@gnu.org; Mon, 06 Feb 2017 23:41:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1caxaP-0005ld-VA for bug-gnu-emacs@gnu.org; Mon, 06 Feb 2017 23:41:03 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60032) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1caxaP-0005lW-RO for bug-gnu-emacs@gnu.org; Mon, 06 Feb 2017 23:41:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1caxaP-0008S0-M6 for bug-gnu-emacs@gnu.org; Mon, 06 Feb 2017 23:41:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Feb 2017 04:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25590 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25590-submit@debbugs.gnu.org id=B25590.148644242832438 (code B ref 25590); Tue, 07 Feb 2017 04:41:01 +0000 Original-Received: (at 25590) by debbugs.gnu.org; 7 Feb 2017 04:40:28 +0000 Original-Received: from localhost ([127.0.0.1]:58231 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1caxZs-0008R8-0M for submit@debbugs.gnu.org; Mon, 06 Feb 2017 23:40:28 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:48649) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1caxZp-0008Qv-Ip for 25590@debbugs.gnu.org; Mon, 06 Feb 2017 23:40:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1caxZj-0005Pq-29 for 25590@debbugs.gnu.org; Mon, 06 Feb 2017 23:40:20 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59682) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1caxZZ-0005LM-Di; Mon, 06 Feb 2017 23:40:09 -0500 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1caxZX-00028x-Ra; Mon, 06 Feb 2017 23:40:08 -0500 X-Spook: data haven BLU-114/B Crest Artistic Assassins Marxist X-Ran: >^M,Zfj(wu85z&ngIf#J>BTOT;:_PaJP*7s'%EUWBVCjWV0JmrUYLrnjZ|S9ZV.>\Wm3c* X-Hue: brightyellow X-Attribution: GM In-Reply-To: (Noam Postavsky's message of "Mon, 6 Feb 2017 13:34:40 -0500") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:129054 Archived-At: 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'. * 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,