aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Corallo2021-01-06 15:26:38 +0100
committerAndrea Corallo2021-01-06 15:52:58 +0100
commit33b8ce865fcfd58538ae2d7c3fff04998fcd3330 (patch)
tree384902e9f2fc18e9e986762d6fb563478fcff854
parent8ad983c4acef60a80e8d6b6ba891b1ef957f2d7c (diff)
downloademacs-33b8ce865fcfd58538ae2d7c3fff04998fcd3330.tar.gz
emacs-33b8ce865fcfd58538ae2d7c3fff04998fcd3330.zip
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.
-rw-r--r--lisp/emacs-lisp/comp.el1
-rw-r--r--test/src/comp-test-45603.el28
-rw-r--r--test/src/comp-tests.el5
3 files changed, 34 insertions, 0 deletions
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."
3550 (file-name-base output) "-") 3550 (file-name-base output) "-")
3551 nil ".el"))) 3551 nil ".el")))
3552 (with-temp-file temp-file 3552 (with-temp-file temp-file
3553 (insert ";; -*-coding: nil; -*-\n")
3553 (insert (prin1-to-string expr))) 3554 (insert (prin1-to-string expr)))
3554 (with-temp-buffer 3555 (with-temp-buffer
3555 (unwind-protect 3556 (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 @@
1;;; -*- lexical-binding: t; -*-
2
3;; Reduced from ivy.el.
4
5(defvar comp-test-45603-last)
6(defvar comp-test-45603-mark-prefix)
7(defvar comp-test-45603-directory)
8(defvar comp-test-45603-marked-candidates)
9
10(defun comp-test-45603--call-marked (action)
11 (let* ((prefix-len (length comp-test-45603-mark-prefix))
12 (marked-candidates
13 (mapcar
14 (lambda (s)
15 (let ((cand (substring s prefix-len)))
16 (if comp-test-45603-directory
17 (expand-file-name cand comp-test-45603-directory)
18 cand)))
19 comp-test-45603-marked-candidates))
20 (multi-action (comp-test-45603--get-multi-action comp-test-45603-last)))))
21
22(defalias 'comp-test-45603--file-local-name
23 (if (fboundp 'file-local-name)
24 #'file-local-name
25 (lambda (file)
26 (or (file-remote-p file 'localname) file))))
27
28(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."
492 (should (string= (comp-test-45635-f :height 180 :family "PragmataPro Liga") 492 (should (string= (comp-test-45635-f :height 180 :family "PragmataPro Liga")
493 "PragmataPro Liga"))) 493 "PragmataPro Liga")))
494 494
495(comp-deftest 45603-1 ()
496 "<https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-12/msg01994.html>"
497 (load (native-compile (concat comp-test-directory "comp-test-45603.el")))
498 (should (fboundp #'comp-test-45603--file-local-name)))
499
495 500
496;;;;;;;;;;;;;;;;;;;;; 501;;;;;;;;;;;;;;;;;;;;;
497;; Tromey's tests. ;; 502;; Tromey's tests. ;;