emacs-diffs
[Top][All Lists]
Advanced

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

feature/android bf93380c1c9 1/4: Merge remote-tracking branch 'origin/ma


From: Po Lu
Subject: feature/android bf93380c1c9 1/4: Merge remote-tracking branch 'origin/master' into feature/android
Date: Fri, 3 Mar 2023 03:10:15 -0500 (EST)

branch: feature/android
commit bf93380c1c9a319840f89106ff6b9492faf923b4
Merge: e18cbd0cc64 828c49ae29f
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Merge remote-tracking branch 'origin/master' into feature/android
---
 lisp/emacs-lisp/byte-opt.el            | 13 ++++++-------
 lisp/emacs-lisp/bytecomp.el            |  1 +
 lisp/net/tramp.el                      |  4 +++-
 test/lisp/emacs-lisp/bytecomp-tests.el |  9 +++++++++
 test/lisp/net/tramp-tests.el           |  5 +++++
 5 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
index 0ae4c452c73..3c7aeb89525 100644
--- a/lisp/emacs-lisp/byte-opt.el
+++ b/lisp/emacs-lisp/byte-opt.el
@@ -439,13 +439,12 @@ for speeding up processing.")
                               (byte-optimize-body (cdr clause) for-effect))))
                     clauses)))
 
-      ;; `unwind-protect' is a special form which here takes the shape
-      ;; (unwind-protect EXPR :fun-body UNWIND-FUN).
-      ;; We can treat it as if it were a plain function at this point,
-      ;; although there are specific optimizations possible.
-      ;; In particular, the return value of UNWIND-FUN is never used
-      ;; so its body should really be compiled for-effect, but we
-      ;; don't do that right now.
+      (`(unwind-protect ,protected-expr :fun-body ,unwind-fun)
+       ;; FIXME: The return value of UNWIND-FUN is never used so we
+       ;; could potentially optimise it for-effect, but we don't do
+       ;; that right no.
+       `(,fn ,(byte-optimize-form protected-expr for-effect)
+             :fun-body ,(byte-optimize-form unwind-fun)))
 
       (`(catch ,tag . ,exps)
        `(,fn ,(byte-optimize-form tag nil)
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 095468ad978..6f3d7a70903 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -4590,6 +4590,7 @@ Return (TAIL VAR TEST CASES), where:
         (if switch-prefix
             (progn
               (byte-compile-cond-jump-table (cdr switch-prefix) donetag)
+              (setq clause nil)
               (setq clauses (car switch-prefix)))
           (setq clause (car clauses))
           (cond ((or (eq (car clause) t)
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 1b434a726a1..47173b95bea 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -4791,7 +4791,9 @@ Do not set it manually, it is used buffer-local in 
`tramp-get-lock-pid'.")
        ;; Trigger the unlock error.
        (signal 'file-error `("Cannot remove lock file for" ,file)))
     ;; `userlock--handle-unlock-error' exists since Emacs 28.1.
-    (error (tramp-compat-funcall 'userlock--handle-unlock-error err))))
+    (error
+     (when create-lockfiles
+       (tramp-compat-funcall 'userlock--handle-unlock-error err)))))
 
 (defun tramp-handle-load (file &optional noerror nomessage nosuffix 
must-suffix)
   "Like `load' for Tramp files."
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el 
b/test/lisp/emacs-lisp/bytecomp-tests.el
index b6dcfeedb0c..10b009a261c 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -757,6 +757,15 @@ inner loops respectively."
         (bytecomp-test-identity 3)
       (error 'bad)
       (:success))                       ; empty handler
+
+    ;; `cond' miscompilation bug
+    (let ((fn (lambda (x)
+                (let ((y nil))
+                  (cond ((progn (setq x (1+ x)) (> x 10)) (setq y 'a))
+                        ((eq x 1) (setq y 'b))
+                        ((eq x 2) (setq y 'c)))
+                  (list x y)))))
+      (mapcar fn (bytecomp-test-identity '(0 1 2 3 10 11))))
     )
   "List of expressions for cross-testing interpreted and compiled code.")
 
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 948bf0ab9e2..b6ad2e2f219 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -4590,6 +4590,11 @@ This tests also `make-symbolic-link', `file-truename' 
and `add-name-to-file'."
              (should (equal (file-name-completion "foo" tmp-name) t))
              (should (equal (file-name-completion "b" tmp-name) "bo"))
              (should-not (file-name-completion "a" tmp-name))
+             ;; `file-name-completion' should not err out if
+             ;; directory does not exist.  (Bug#61890)
+             (should-not
+              (file-name-completion
+               "a" (tramp-compat-file-name-concat tmp-name "fuzz")))
              ;; Ange-FTP does not support predicates.
              (unless (tramp--test-ange-ftp-p)
                (should



reply via email to

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