1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-24 07:20:37 +00:00

Merge from origin/emacs-27

44104a607a Fix error in GMP test
e26e63444d Add Feature testing for Windows binaries
4e2caef384 ; * src/character.c (str_as_multibyte): Fix the commentary.
d3a4ce8420 Revert "; * etc/NEWS: Remove temporary note on documentati...
16f00e36dc * admin/admin.el (set-version): Trap yet another NEWS error.
121be3e118 ; * etc/NEWS: Remove temporary note on documentation.  (Bu...
5fcb97dabd Fix cond jump table compilation (bug#42919)
This commit is contained in:
Michael Albinus 2020-08-25 15:29:38 +02:00
commit 36f2f67c96
6 changed files with 131 additions and 34 deletions

View File

@ -151,7 +151,7 @@ Root must be the root of an Emacs source tree."
(display-warning 'admin
"NEWS file contains empty sections - remove them?"))
(goto-char (point-min))
(if (re-search-forward "^\\(\\+\\+\\+ *\\|--- *\\)$" nil t)
(if (re-search-forward "^\\(\\+\\+\\+ *$\\|--- *$\\|Temporary note:\\)" nil t)
(display-warning 'admin
"NEWS file still contains temporary markup.
Documentation changes might not have been completed!"))))

View File

@ -24,7 +24,6 @@ applies, and please also update docstrings as needed.
* Installation Changes in Emacs 27.1
---
** Emacs now uses GMP, the GNU Multiple Precision library.
By default, if 'configure' does not find a suitable libgmp, it
arranges for the included mini-gmp library to be built and used.
@ -58,7 +57,6 @@ that building with Cairo enabled results in using Pango instead of
libXft for font support, and that Pango 1.44 has removed support for
bitmapped fonts.
+++
** Emacs now uses a "portable dumper" instead of unexec.
This improves compatibility with memory allocation on modern systems,
and in particular better supports the Address Space Layout

87
etc/w32-feature.el Normal file
View File

@ -0,0 +1,87 @@
;;; w32-feature.el --- Check Availability of Emacs Features -*- lexical-binding: t -*-
;; Copyright (C) 2020 Free Software Foundation, Inc.
;; Author: Phillip Lord <phillip.lord@russet.org.uk>
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; This file provides tests for various features of Emacs. It is
;; designed to check whether bundled binary distributions of Emacs on
;; windows are fully functional.
;;; Code:
(require 'ert)
(ert-deftest feature-optimization ()
(should
(string-match-p "CFLAGS=-O2" system-configuration-options)))
(ert-deftest feature-harfbuzz ()
(should
(eq
'harfbuzz
(car (frame-parameter nil 'font-backend)))))
(ert-deftest feature-gnutls ()
(should (gnutls-available-p)))
(ert-deftest feature-zlib ()
(should (zlib-available-p)))
(ert-deftest feature-thread ()
(should (fboundp 'make-thread)))
(ert-deftest feature-json ()
(should
(fboundp 'json-serialize)))
(ert-deftest feature-gmp ()
(should
(string-match-p "GMP" system-configuration-features)))
(ert-deftest feature-module ()
(should (fboundp 'module-load)))
(ert-deftest feature-libxml ()
(should (libxml-available-p)))
(ert-deftest feature-lcms2 ()
(should (lcms2-available-p)))
(ert-deftest feature-xpm ()
(should (image-type-available-p 'xpm)))
(ert-deftest feature-gif ()
(should (image-type-available-p 'gif)))
(ert-deftest feature-png ()
(should (image-type-available-p 'png)))
(ert-deftest feature-xpm ()
(should (image-type-available-p 'xpm)))
(ert-deftest feature-jpeg ()
(should (image-type-available-p 'jpeg)))
(ert-deftest feature-tiff ()
(should (image-type-available-p 'tiff)))
(ert-deftest feature-svg ()
(should (image-type-available-p 'svg)))
;;; feature.el ends here

View File

@ -4132,40 +4132,44 @@ Return (TAIL VAR TEST CASES), where:
(switch-var nil)
(switch-test 'eq))
(while (pcase (car clauses)
(`((,fn ,expr1 ,expr2) . ,body)
(`((,(and fn (or 'eq 'eql 'equal)) ,expr1 ,expr2) . ,body)
(let* ((vars (byte-compile--cond-vars expr1 expr2))
(var (car vars))
(value (cdr vars)))
(and var (or (eq var switch-var) (not switch-var))
(cond
((memq fn '(eq eql equal))
(progn
(setq switch-var var)
(setq switch-test
(byte-compile--common-test switch-test fn))
(unless (member value keys)
(push value keys)
(push (cons (list value) (or body '(t))) cases))
t)
((and (memq fn '(memq memql member))
(listp value)
;; Require a non-empty body, since the member
;; function value depends on the switch
;; argument.
body)
(setq switch-var var)
(setq switch-test
(byte-compile--common-test
switch-test (cdr (assq fn '((memq . eq)
(memql . eql)
(member . equal))))))
(let ((vals nil))
(dolist (elem value)
(unless (funcall fn elem keys)
(push elem vals)))
(when vals
(setq keys (append vals keys))
(push (cons (nreverse vals) body) cases)))
t))))))
t))))
(`((,(and fn (or 'memq 'memql 'member)) ,var ,expr) . ,body)
(and (symbolp var)
(or (eq var switch-var) (not switch-var))
(macroexp-const-p expr)
;; Require a non-empty body, since the member
;; function value depends on the switch argument.
body
(let ((value (eval expr)))
(and (proper-list-p value)
(progn
(setq switch-var var)
(setq switch-test
(byte-compile--common-test
switch-test
(cdr (assq fn '((memq . eq)
(memql . eql)
(member . equal))))))
(let ((vals nil))
(dolist (elem value)
(unless (funcall fn elem keys)
(push elem vals)))
(when vals
(setq keys (append vals keys))
(push (cons (nreverse vals) body) cases)))
t))))))
(setq clauses (cdr clauses)))
;; Assume that a single switch is cheaper than two or more discrete
;; compare clauses. This could be tuned, possibly taking into

View File

@ -495,9 +495,9 @@ parse_str_as_multibyte (const unsigned char *str, ptrdiff_t len,
/* Arrange unibyte text at STR of NBYTES bytes as a multibyte text.
It actually converts only such 8-bit characters that don't construct
a multibyte sequence to multibyte forms of Latin-1 characters. If
NCHARS is nonzero, set *NCHARS to the number of characters in the
text. It is assured that we can use LEN bytes at STR as a work
a multibyte sequence to multibyte forms of raw bytes. If NCHARS
is nonzero, set *NCHARS to the number of characters in the text.
It is assured that we can use LEN bytes at STR as a work
area and that is enough. Return the number of bytes of the
resulting text. */

View File

@ -354,10 +354,18 @@
'((a c) (b c) (7 c) (-3 c) (nil nil) (t c) (q c) (r c) (s c)
(t c) (x "a") (x "c") (x c) (x d) (x e)))
;; `substring' bytecode generation (bug#39709).
(substring "abcdef")
(substring "abcdef" 2)
(substring "abcdef" 3 2))
(mapcar (lambda (x) (cond ((member '(a . b) x) 1)
((equal x '(c)) 2)))
'(((a . b)) a b (c) (d)))
(mapcar (lambda (x) (cond ((memq '(a . b) x) 1)
((equal x '(c)) 2)))
'(((a . b)) a b (c) (d)))
(mapcar (lambda (x) (cond ((member '(a b) x) 1)
((equal x '(c)) 2)))
'(((a b)) a b (c) (d)))
(mapcar (lambda (x) (cond ((memq '(a b) x) 1)
((equal x '(c)) 2)))
'(((a b)) a b (c) (d))))
"List of expression for test.
Each element will be executed by interpreter and with
bytecompiled code, and their results compared.")