emacs-diffs
[Top][All Lists]
Advanced

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

master 36f2f67: Merge from origin/emacs-27


From: Michael Albinus
Subject: master 36f2f67: Merge from origin/emacs-27
Date: Tue, 25 Aug 2020 09:30:15 -0400 (EDT)

branch: master
commit 36f2f67c96d44c82ce31dafb38cd4e2622a5a372
Merge: 478c2e2 44104a6
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>

    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)
---
 admin/admin.el                         |  2 +-
 etc/NEWS.27                            |  2 -
 etc/w32-feature.el                     | 87 ++++++++++++++++++++++++++++++++++
 lisp/emacs-lisp/bytecomp.el            | 52 ++++++++++----------
 src/character.c                        |  6 +--
 test/lisp/emacs-lisp/bytecomp-tests.el | 16 +++++--
 6 files changed, 131 insertions(+), 34 deletions(-)

diff --git a/admin/admin.el b/admin/admin.el
index 923f010..310cd54 100644
--- a/admin/admin.el
+++ b/admin/admin.el
@@ -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!"))))
diff --git a/etc/NEWS.27 b/etc/NEWS.27
index 31b6902..5ef5430 100644
--- a/etc/NEWS.27
+++ b/etc/NEWS.27
@@ -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
diff --git a/etc/w32-feature.el b/etc/w32-feature.el
new file mode 100644
index 0000000..3c0f741
--- /dev/null
+++ b/etc/w32-feature.el
@@ -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
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 7ae8749..966990b 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -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
diff --git a/src/character.c b/src/character.c
index 4902e56..5860f6a 100644
--- a/src/character.c
+++ b/src/character.c
@@ -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.  */
 
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el 
b/test/lisp/emacs-lisp/bytecomp-tests.el
index 834e3b6..a9dcf15 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -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.")



reply via email to

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