From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.bugs Subject: bug#48029: 28.1; [native-comp] Function names with non-ascii characters Date: Fri, 08 Jul 2022 08:49:42 +0000 Message-ID: References: <877dkp2zr6.fsf@miha-pc> <874kfliksx.fsf@gnus.org> <87bkua8fga.fsf@gnus.org> <8335fh9lah.fsf@gnu.org> <87bku0g6h7.fsf@gnus.org> <83pmig40s4.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21033"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: larsi@gnus.org, 48029@debbugs.gnu.org, jakanakaevangeli@chiru.no To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 08 10:50:17 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o9jgm-0005GY-VR for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 08 Jul 2022 10:50:17 +0200 Original-Received: from localhost ([::1]:54626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o9jgl-0004VE-Ge for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 08 Jul 2022 04:50:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57804) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o9jga-0004Ur-68 for bug-gnu-emacs@gnu.org; Fri, 08 Jul 2022 04:50:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36610) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o9jgY-0002qt-B8 for bug-gnu-emacs@gnu.org; Fri, 08 Jul 2022 04:50:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o9jgY-0000ek-7a for bug-gnu-emacs@gnu.org; Fri, 08 Jul 2022 04:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Jul 2022 08:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48029 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 48029-submit@debbugs.gnu.org id=B48029.16572701942494 (code B ref 48029); Fri, 08 Jul 2022 08:50:02 +0000 Original-Received: (at 48029) by debbugs.gnu.org; 8 Jul 2022 08:49:54 +0000 Original-Received: from localhost ([127.0.0.1]:58740 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o9jgP-0000e9-HA for submit@debbugs.gnu.org; Fri, 08 Jul 2022 04:49:53 -0400 Original-Received: from mx.sdf.org ([205.166.94.24]:62451) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o9jgK-0000de-9r for 48029@debbugs.gnu.org; Fri, 08 Jul 2022 04:49:51 -0400 Original-Received: from ma.sdf.org (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 2688nfvv021403 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Fri, 8 Jul 2022 08:49:42 GMT In-Reply-To: <83pmig40s4.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 08 Jul 2022 08:43:39 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:236438 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Eli Zaretskii writes: >> From: Andrea Corallo >> Cc: Eli Zaretskii , 48029@debbugs.gnu.org, >> jakanakaevangeli@chiru.no >> Date: Thu, 07 Jul 2022 20:51:48 +0000 >>=20 >> We have the symbol `nonascii-test-=C5=BE=C5=BE=C5=BE' correct into our p= ipeline. >>=20 >> Then we prepare the file that will be executed by the subprocess that >> will do the actual compilation, we do this in `comp-final'. >>=20 >> Here when we print `nonascii-test-=C5=BE=C5=BE=C5=BE' using `prin1-to-st= ring' this >> becomes "nonascii-test-\x017e\x017e\x017e" (exploring it with the >> debugger). >>=20 >> This is then stored in the temp file I mentioned, the file has on top >> ";; -*-coding: nil; -*- " and the symbol is shown as >> "nonascii-test-\305\276\305\276\305\276" if I visit it on my emacs. >>=20 >> Now two options, either we are not printing it as we should or either >> the reader doesn't know he has to handle these non ascii characters >> while reading back. >>=20 >> I'm no expert in this area, I guess will be evident to experts what we >> are not doing correctly here. > > Why do we have ";; -*-coding: nil; -*- "? I think that's the problem: > it should be ";; -*-coding: utf-8; -*- " instead. Where does the nil > come from? AFAIR at the time we encountered a situation when one of these files was read back with some other encoding (I guess it's heuristic?) so fixing the encoding to nil solved the issue. > Lisp sources are by default UTF-8 encoded, so that should be the > default for the temp file we write. Bonus points for using the actual > encoding of the Lisp source file there (which in very rare cases can > be something other than UTF-8). Ok attached the patch that sets it to utf-8, seems to work for me. I'll have a look on how to spill the original coding system and get the bonus points hopefully next week. Should this patch go in master or into the release branch? Regards Andrea --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=0001-Mark-async-worker-tmp-file-as-utf-8-bug-48029.patch Content-Transfer-Encoding: quoted-printable >From 76f18b38989e13136c191d40ef5c497161947394 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Fri, 8 Jul 2022 10:27:45 +0200 Subject: [PATCH] Mark async worker tmp file as utf-8 (bug#48029) MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-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-=C5=BE=C5=BE=C5=BE-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 73285e0f24..9555bc8bd1 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -3693,7 +3693,7 @@ comp-final (file-name-base output) "-") nil ".el"))) (with-temp-file temp-file - (insert ";; -*-coding: nil; -*-\n") + (insert ";; -*-coding: utf-8; -*-\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-res= ources/comp-test-funcs.el index 0a60f4d6cc..9092f040c8 100644 --- a/test/src/comp-resources/comp-test-funcs.el +++ b/test/src/comp-resources/comp-test-funcs.el @@ -515,6 +515,8 @@ comp-test-47868-3-f (defun comp-test-47868-4-f () #(" " 0 1 (face font-lock-keyword-face))) =20 +(defun comp-test-48029-nonascii-=C5=BE=C5=BE=C5=BE-f (arg) + (when arg t)) =20 ;;;;;;;;;;;;;;;;;;;; diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index e7b534d00e..c7e81298d2 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -532,6 +532,11 @@ comp-test-47868-1 (should (eq (comp-test-47868-1-f) (comp-test-47868-3-f))) (should (eq (comp-test-47868-2-f) (comp-test-47868-4-f)))) =20 +(comp-deftest 48029-1 () + "" + (should (subr-native-elisp-p + (symbol-function 'comp-test-48029-nonascii-=C5=BE=C5=BE=C5=BE-f= )))) + ;;;;;;;;;;;;;;;;;;;;; ;; Tromey's tests. ;; --=20 2.25.1 --=-=-=--