From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#15260: cannot build in a directory with non-ascii characters Date: Fri, 01 Nov 2013 11:27:36 +0200 Message-ID: <83txfwbhfb.fsf@gnu.org> References: <83bo2dgq36.fsf@gnu.org> <837gd1gpcz.fsf@gnu.org> <8361slgnhk.fsf@gnu.org> <83zjpwfp3l.fsf@gnu.org> <83mwlug0cd.fsf@gnu.org> <83bo2af4hh.fsf@gnu.org> <8361shfil7.fsf@gnu.org> <834n81fdp8.fsf@gnu.org> <83zjpseo1g.fsf@gnu.org> <838uxaei43.fsf@gnu.org> <831u32drtn.fsf@gnu.org> <83sivhcodj.fsf@gnu.org> <83iowdck1p.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1383298155 10402 80.91.229.3 (1 Nov 2013 09:29:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 1 Nov 2013 09:29:15 +0000 (UTC) Cc: 15260@debbugs.gnu.org To: monnier@iro.umontreal.ca Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 01 10:29:18 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VcB2c-0000H3-Fn for geb-bug-gnu-emacs@m.gmane.org; Fri, 01 Nov 2013 10:29:18 +0100 Original-Received: from localhost ([::1]:36823 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VcB2b-00021u-RU for geb-bug-gnu-emacs@m.gmane.org; Fri, 01 Nov 2013 05:29:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55977) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VcB2S-0001oB-Ql for bug-gnu-emacs@gnu.org; Fri, 01 Nov 2013 05:29:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VcB2N-0006Na-1A for bug-gnu-emacs@gnu.org; Fri, 01 Nov 2013 05:29:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42463) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VcB2M-0006NS-Tx for bug-gnu-emacs@gnu.org; Fri, 01 Nov 2013 05:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VcB2M-0007PM-B3 for bug-gnu-emacs@gnu.org; Fri, 01 Nov 2013 05:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 01 Nov 2013 09:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15260 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15260-submit@debbugs.gnu.org id=B15260.138329808228384 (code B ref 15260); Fri, 01 Nov 2013 09:29:02 +0000 Original-Received: (at 15260) by debbugs.gnu.org; 1 Nov 2013 09:28:02 +0000 Original-Received: from localhost ([127.0.0.1]:56480 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VcB1N-0007Nd-LL for submit@debbugs.gnu.org; Fri, 01 Nov 2013 05:28:02 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:49345) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VcB1L-0007NL-4w for 15260@debbugs.gnu.org; Fri, 01 Nov 2013 05:28:00 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MVK00F00VLEPK00@a-mtaout22.012.net.il> for 15260@debbugs.gnu.org; Fri, 01 Nov 2013 11:27:52 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MVK00F3MVME9JC0@a-mtaout22.012.net.il>; Fri, 01 Nov 2013 11:27:50 +0200 (IST) In-reply-to: <83iowdck1p.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:79848 Archived-At: > Date: Thu, 31 Oct 2013 21:33:22 +0200 > From: Eli Zaretskii > Cc: 15260@debbugs.gnu.org > > > > +;; Make sure default-directory is unibyte when dumping. This is > > > +;; because we cannot decode and encode it correctly (since the locale > > > +;; environment is not, and should not be, set up). default-directory > > > +;; is used every time we call expand-file-name, which we do in every > > > +;; file primitive. So the only workable solution to support building > > > +;; in non-ASCII directories is to manipulate unibyte strings in the > > > +;; current locale's encoding. > > > +(if (and (or (equal (nth 3 command-line-args) "dump") > > > + (equal (nth 4 command-line-args) "dump") > > > + (equal (nth 3 command-line-args) "bootstrap") > > > + (equal (nth 4 command-line-args) "bootstrap")) > > > + (multibyte-string-p default-directory)) > > > + (setq default-directory (string-to-unibyte default-directory))) > > > > I'm not sure I understand this string-to-unibyte. > > This call seems to only be correct if default-directory holds the > > undecoded but multibyte name. > > Why would we have an undecided yet multibyte name? > > This was a necessity before I removed this quirk from init_buffer: > > --- src/buffer.c 2013-10-29 14:46:23 +0000 > +++ src/buffer.c 2013-10-31 16:57:18 +0000 > @@ -5349,13 +5349,10 @@ init_buffer (void) > len++; > } > > + /* At this moment, we still don't know how to decode the directory > + name. So, we keep the bytes in unibyte form so that file I/O > + routines correctly get the original bytes. */ > bset_directory (current_buffer, make_unibyte_string (pwd, len)); > - if (! NILP (BVAR (&buffer_defaults, enable_multibyte_characters))) > - /* At this moment, we still don't know how to decode the > - directory name. So, we keep the bytes in multibyte form so > - that ENCODE_FILE correctly gets the original bytes. */ > - bset_directory > - (current_buffer, string_to_multibyte (BVAR (current_buffer, directory))); > > /* Add /: to the front of the name > if it would otherwise be treated as magic. */ > > After removing that, it's probably not needed anymore, since now > default-directory should be a unibyte string from the very beginning. Would you prefer that we error out of default-directory is not a unibyte string at that point in loadup.el?