From 7af88de4103e6467e8edc9c7a15a97361d99822f Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Fri, 8 Jul 2022 10:27:45 +0200 Subject: [PATCH 1/2] Mark async worker tmp file as utf-8-emacs-unix (bug#48029) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lisp/emacs-lisp/comp.el (comp-final): Mark async worker tmp file as utf-8. * test/src/comp-tests.el (48029-1): New test. * test/src/comp-resources/comp-test-funcs.el (comp-test-48029-nonascii-žžž-f): New function. --- lisp/emacs-lisp/comp.el | 2 +- test/src/comp-resources/comp-test-funcs.el | 2 ++ test/src/comp-tests.el | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 7d09d2425b2..374b39e9990 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -3697,7 +3697,7 @@ Prepare every function for final compilation and drive the C back-end." (file-name-base output) "-") nil ".el"))) (with-temp-file temp-file - (insert ";; -*-coding: nil; -*-\n") + (insert ";; -*-coding: utf-8-emacs-unix; -*-\n") (mapc (lambda (e) (insert (prin1-to-string e))) expr)) diff --git a/test/src/comp-resources/comp-test-funcs.el b/test/src/comp-resources/comp-test-funcs.el index d740a5f8107..4cd4cc141fe 100644 --- a/test/src/comp-resources/comp-test-funcs.el +++ b/test/src/comp-resources/comp-test-funcs.el @@ -515,6 +515,8 @@ (defun comp-test-47868-4-f () #(" " 0 1 (face font-lock-keyword-face))) +(defun comp-test-48029-nonascii-žžž-f (arg) + (when arg t)) ;;;;;;;;;;;;;;;;;;;; diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index 96f2b42c0d7..af40eb247de 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -513,6 +513,11 @@ https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-03/msg00914.html." (should (eq (comp-test-47868-1-f) (comp-test-47868-3-f))) (should (eq (comp-test-47868-2-f) (comp-test-47868-4-f)))) +(comp-deftest 48029-1 () + "" + (should (subr-native-elisp-p + (symbol-function 'comp-test-48029-nonascii-žžž-f)))) + ;;;;;;;;;;;;;;;;;;;;; ;; Tromey's tests. ;; From 9db6817d638bf93a98de58612bac46e1ff425f26 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Fri, 8 Jul 2022 15:54:20 +0200 Subject: [PATCH 2/2] Remove uneffective test * test/src/comp-tests.el (45603-1): Remove test. * test/src/comp-resources/comp-test-45603.el: Delete. --- test/src/comp-resources/comp-test-45603.el | 28 ---------------------- test/src/comp-tests.el | 5 ---- 2 files changed, 33 deletions(-) delete mode 100644 test/src/comp-resources/comp-test-45603.el diff --git a/test/src/comp-resources/comp-test-45603.el b/test/src/comp-resources/comp-test-45603.el deleted file mode 100644 index f1c0dafb68d..00000000000 --- a/test/src/comp-resources/comp-test-45603.el +++ /dev/null @@ -1,28 +0,0 @@ -;;; -*- lexical-binding: t; -*- - -;; Reduced from ivy.el. - -(defvar comp-test-45603-last) -(defvar comp-test-45603-mark-prefix) -(defvar comp-test-45603-directory) -(defvar comp-test-45603-marked-candidates) - -(defun comp-test-45603--call-marked (action) - (let* ((prefix-len (length comp-test-45603-mark-prefix)) - (marked-candidates - (mapcar - (lambda (s) - (let ((cand (substring s prefix-len))) - (if comp-test-45603-directory - (expand-file-name cand comp-test-45603-directory) - cand))) - comp-test-45603-marked-candidates)) - (multi-action (comp-test-45603--get-multi-action comp-test-45603-last))))) - -(defalias 'comp-test-45603--file-local-name - (if (fboundp 'file-local-name) - #'file-local-name - (lambda (file) - (or (file-remote-p file 'localname) file)))) - -(provide 'comp-test-45603) diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index af40eb247de..26fdfc7d07d 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -489,11 +489,6 @@ https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-03/msg00914.html." (should (string= (comp-test-45635-f :height 180 :family "PragmataPro Liga") "PragmataPro Liga"))) -(comp-deftest 45603-1 () - "" - (load (native-compile (ert-resource-file "comp-test-45603.el"))) - (should (fboundp #'comp-test-45603--file-local-name))) - (comp-deftest 46670-1 () "" (should (string= (comp-test-46670-2-f "foo") "foo"))