unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: rgm@gnu.org, 15803@debbugs.gnu.org
Subject: bug#15803: default-file-name-coding-system: utf-8 better than latin-1 these days?
Date: Fri, 11 Sep 2020 13:27:28 +0200	[thread overview]
Message-ID: <87een81rkv.fsf@gnus.org> (raw)
In-Reply-To: <83h7s4h8uh.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 11 Sep 2020 14:05:26 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> But I think I know why "make check" was failing:
>> 
>> [larsi@stories ~/src/emacs/trunk]$ echo $LANG
>> sv_SE.ISO-8859-1
>> [larsi@stories ~/src/emacs/trunk]$ echo $LANG
>> en_US.UTF-8
>
> I don't understand this: 2 identical commands one after the other
> yield different results?

Sorry, there was a "bash" started in between there.

>> This time over, the directory is "fóo" (in latin-1), and that looks like
>> Emacs is trying to find the utf-8 version of the file name.
>
> If that's the case, then we lack ENCODE_FILE (or more generally don't
> encode a file name) somewhere.

After instrumenting bytecomp (i.e., adding a bunch of messages), I see
what function is actually failing.  With this in byte-compile-file:

                  (message "foo2: %S" (prin1-to-string tempfile))
		  (unless (= temp-modes desired-modes)
		    (set-file-modes tempfile desired-modes 'nofollow))
                  (message "foo1: %S" (prin1-to-string tempfile))

I get this output:

make[1]: Entering directory '/home/larsi/src/emacs/f�o/test'
  ELC      lisp/eshell/eshell-tests.elc
foo2: "#(\"/home/larsi/src/emacs/fóo/test/lisp/eshell/eshell-tests.elcnjDFYY\" 0 65 (charset iso-8859-1))"
>>Error occurred processing lisp/eshell/eshell-tests.el: File is missing (("Doing chmod" "No such file or directory" "/home/larsi/src/emacs/f\303\263o/test/lisp/eshell/eshell-tests.elcnjDFYY"))
make[1]: *** [Makefile:165: lisp/eshell/eshell-tests.elc] Error 1

So it's created a tempfile, tagged with the correct charset (I had no
idea that that's how it worked), but decoded, and then set-file-modes
interprets that as an UTF-8 file name.

So...  it's a bug in set-file-modes?  Hm, nope, write-region has the
same problem.

That weird file name (decoded and tagged with a charset text parameter)
comes from make-temp-file -- everything seems to be OK before that.
target-file is:

foo: "\"/home/larsi/src/emacs/f\\363o/test/lisp/eshell/eshell-tests.elc\""

which seems to be correct, but

		       (tempfile
			(make-temp-file (expand-file-name target-file)))

is

"#(\"/home/larsi/src/emacs/fóo/test/lisp/eshell/eshell-tests.elcnjDFYY\" 0 65 (charset iso-8859-1))"

and then things fail.  Which makes me wonder why building Emacs at all
works if it's such a fundamental problem...  Just to check whether my
system is switching the LANG back to utf-8:

          (message "foo: %S" (getenv "LC_ALL"))

in byte-compile-file says

foo: "sv_SE.ISO-8859-1"

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2020-09-11 11:27 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-04 18:45 bug#15803: default-file-name-coding-system: utf-8 better than latin-1 these days? Glenn Morris
2017-12-01  1:52 ` Glenn Morris
2017-12-01  7:54   ` Eli Zaretskii
2017-12-05  0:35     ` Glenn Morris
2017-12-08  9:46       ` Eli Zaretskii
2017-12-12  1:38         ` Glenn Morris
2020-09-09 13:15           ` Lars Ingebrigtsen
2020-09-09 15:00             ` Eli Zaretskii
2020-09-10 13:07               ` Lars Ingebrigtsen
2020-09-10 14:39                 ` Eli Zaretskii
2020-09-11 10:55                   ` Lars Ingebrigtsen
2020-09-11 11:05                     ` Eli Zaretskii
2020-09-11 11:27                       ` Lars Ingebrigtsen [this message]
2020-09-11 12:24                         ` Eli Zaretskii
2020-09-11 12:33                           ` Lars Ingebrigtsen
2020-09-11 12:41                             ` Eli Zaretskii
2020-09-11 14:18                               ` Lars Ingebrigtsen
2020-09-11 14:27                                 ` Lars Ingebrigtsen
2020-09-11 14:46                                   ` Eli Zaretskii
2020-09-11 14:54                                     ` Lars Ingebrigtsen
2020-09-11 15:11                                       ` Eli Zaretskii
2020-09-12  8:47                                         ` Michael Albinus
2020-09-12 11:21                                         ` Lars Ingebrigtsen
2020-09-11 12:39                           ` Lars Ingebrigtsen
2020-09-11 12:45                             ` Eli Zaretskii
2020-09-09 13:33       ` Stefan Kangas
2020-09-09 15:09         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87een81rkv.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=15803@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=rgm@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).