emacs-diffs
[Top][All Lists]
Advanced

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

feature/native-comp 33b8ce8: Fix bug#45603


From: Andrea Corallo
Subject: feature/native-comp 33b8ce8: Fix bug#45603
Date: Wed, 6 Jan 2021 09:53:51 -0500 (EST)

branch: feature/native-comp
commit 33b8ce865fcfd58538ae2d7c3fff04998fcd3330
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>

    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.
---
 lisp/emacs-lisp/comp.el     |  1 +
 test/src/comp-test-45603.el | 28 ++++++++++++++++++++++++++++
 test/src/comp-tests.el      |  5 +++++
 3 files changed, 34 insertions(+)

diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 3247b19..88b6a46 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 0000000..f1c0daf
--- /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 19e0940..c0325a8 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 ()
+  "<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)))
+
 
 ;;;;;;;;;;;;;;;;;;;;;
 ;; Tromey's tests. ;;



reply via email to

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