GNU bug report logs - #15426
24.3.50; Multibyte filenames and directory-files in unibyte buffer

Previous Next

Package: emacs;

Reported by: Andreas Politz <politza <at> hochschule-trier.de>

Date: Fri, 20 Sep 2013 16:49:01 UTC

Severity: normal

Found in version 24.3.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #29 received at 15426 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Politz <politza <at> hochschule-trier.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 15426 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: Re: bug#15426: 24.3.50;
 Multibyte filenames and directory-files in unibyte buffer
Date: Sat, 21 Sep 2013 11:35:52 +0200
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Andreas Politz <politza <at> hochschule-trier.de>
>> 
>> (let ((d "/tmp/\303\204")) ;; utf-8 for german umlaut "A 
>
> This makes d a unibyte string:
>
>   (setq d "/tmp/\303\204")
>   "/tmp/\303\204"
>
>   (multibyte-string-p d)
>     => nil
>
> Why would one do such a thing in the first place?

OK.  The thing is that Emacs does it.

[multibyte-directory-list.el (application/emacs-lisp, inline)]
[Message part 3 (text/plain, inline)]
If I save this in mb-dir/foo.el, where mb-dir is a directory containing
multi-bytes, the results (d1 and d2) of the same calls to
`directory-list' are different in the uni-byte and multi-byte buffer. It
seems that the 2 byte sequences of the UTF-8 characters are replaced by
some 4 bytes. Anyway, the resulting filename d2 names a non-existent
file.

> "The minibuffer displays" is the key point here:[...]

No, the key is that the file's existence depends on the buffer's
multi-byte status, in which the code is evaluated.

>
>> I hope that clarifies it.

-ap

This bug report was last modified 11 years and 242 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.