]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix bug#45603
authorAndrea Corallo <akrl@sdf.org>
Wed, 6 Jan 2021 14:26:38 +0000 (15:26 +0100)
committerAndrea Corallo <akrl@sdf.org>
Wed, 6 Jan 2021 14:52:58 +0000 (15:52 +0100)
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.

lisp/emacs-lisp/comp.el
test/src/comp-test-45603.el [new file with mode: 0644]
test/src/comp-tests.el

index 3247b19c5e24e73f7f6c6b63916a3dccf759c4d9..88b6a4690dff76d9bde1447a766f3956d2ad5707 100644 (file)
@@ -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 (file)
index 0000000..f1c0daf
--- /dev/null
@@ -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)
index 19e0940db84e1defaddb600ed94c8aedcc3c4301..c0325a8d5df54355b2e8e9e73acb1fdf1e660880 100644 (file)
@@ -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 ()
+  "<https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-12/msg01994.html>"
+  (load (native-compile (concat comp-test-directory "comp-test-45603.el")))
+  (should (fboundp #'comp-test-45603--file-local-name)))
+
 \f
 ;;;;;;;;;;;;;;;;;;;;;
 ;; Tromey's tests. ;;