From: Eli Zaretskii <eliz@gnu.org>
To: monnier@iro.umontreal.ca
Cc: 15260@debbugs.gnu.org
Subject: bug#15260: cannot build in a directory with non-ascii characters
Date: Fri, 01 Nov 2013 11:27:36 +0200 [thread overview]
Message-ID: <83txfwbhfb.fsf@gnu.org> (raw)
In-Reply-To: <83iowdck1p.fsf@gnu.org>
> Date: Thu, 31 Oct 2013 21:33:22 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> 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?
next prev parent reply other threads:[~2013-11-01 9:27 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-03 17:46 bug#15260: cannot build in a directory with non-ascii characters Glenn Morris
2013-10-23 20:48 ` Glenn Morris
2013-10-24 18:25 ` Eli Zaretskii
2013-10-24 18:35 ` Glenn Morris
2013-10-25 14:25 ` Eli Zaretskii
2013-10-25 17:08 ` Glenn Morris
2013-10-25 18:31 ` Eli Zaretskii
2013-10-25 18:40 ` Glenn Morris
2013-10-25 18:46 ` Eli Zaretskii
2013-10-25 19:27 ` Eli Zaretskii
2013-10-26 7:50 ` Eli Zaretskii
2013-10-26 19:15 ` Glenn Morris
2013-10-26 20:04 ` Eli Zaretskii
2013-10-27 3:56 ` Eli Zaretskii
2013-10-27 16:19 ` Eli Zaretskii
2013-10-27 19:02 ` Eli Zaretskii
2013-10-27 19:43 ` Eli Zaretskii
2013-10-27 4:28 ` Stefan Monnier
2013-10-27 16:11 ` Eli Zaretskii
2013-10-28 0:30 ` Stefan Monnier
2013-10-28 3:39 ` Eli Zaretskii
2013-10-28 4:05 ` Stefan Monnier
2013-10-28 16:47 ` Eli Zaretskii
2013-10-28 18:33 ` Eli Zaretskii
2013-10-28 22:00 ` Glenn Morris
2013-10-29 3:42 ` Eli Zaretskii
2013-10-29 1:35 ` Stefan Monnier
2013-10-29 3:47 ` Eli Zaretskii
2013-10-29 13:56 ` Stefan Monnier
2013-10-30 18:19 ` Eli Zaretskii
2013-10-31 1:01 ` Stefan Monnier
2013-10-31 3:47 ` Eli Zaretskii
2013-10-31 13:40 ` Stefan Monnier
2013-10-31 16:25 ` Eli Zaretskii
2013-10-31 18:04 ` Stefan Monnier
2013-10-31 17:59 ` Eli Zaretskii
2013-10-31 19:24 ` Stefan Monnier
2013-10-31 19:33 ` Eli Zaretskii
2013-11-01 9:27 ` Eli Zaretskii [this message]
2013-11-01 12:33 ` Stefan Monnier
2013-11-04 17:37 ` Eli Zaretskii
2013-11-04 17:35 ` Eli Zaretskii
2013-11-04 18:38 ` Stefan Monnier
2013-10-31 17:16 ` Eli Zaretskii
2013-10-31 18:09 ` Stefan Monnier
2013-10-31 18:37 ` Eli Zaretskii
2013-10-31 19:41 ` Eli Zaretskii
2013-11-01 13:58 ` Kenichi Handa
2013-10-31 21:45 ` Glenn Morris
2013-11-01 7:45 ` 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=83txfwbhfb.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=15260@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
/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).