From: Andrea Corallo Date: Wed, 6 Jan 2021 14:26:38 +0000 (+0100) Subject: Fix bug#45603 X-Git-Tag: emacs-28.0.90~2727^2~177 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=33b8ce865fcfd58538ae2d7c3fff04998fcd3330;p=emacs.git Fix bug#45603 Reported and reduced by Mauricio Collares. * lisp/emacs-lisp/comp.el (comp-final): Fix coding system for the tmp file used to pass data the child processes. * test/src/comp-tests.el (45603-1): New testcase * test/src/comp-test-45603.el : New File. --- diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 3247b19c5e2..88b6a4690df 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -3550,6 +3550,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 (prin1-to-string expr))) (with-temp-buffer (unwind-protect diff --git a/test/src/comp-test-45603.el b/test/src/comp-test-45603.el new file mode 100644 index 00000000000..f1c0dafb68d --- /dev/null +++ b/test/src/comp-test-45603.el @@ -0,0 +1,28 @@ +;;; -*- 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 19e0940db84..c0325a8d5df 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -492,6 +492,11 @@ 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 (concat comp-test-directory "comp-test-45603.el"))) + (should (fboundp #'comp-test-45603--file-local-name))) + ;;;;;;;;;;;;;;;;;;;;; ;; Tromey's tests. ;;