* File name completion problem with non-ascii file names
@ 2008-04-27 10:36 Ari Roponen
2008-04-27 16:16 ` Drew Adams
2008-04-27 18:07 ` Andreas Schwab
0 siblings, 2 replies; 6+ messages in thread
From: Ari Roponen @ 2008-04-27 10:36 UTC (permalink / raw)
To: emacs-devel
Hi,
when I use C-x C-f to visit a file, TAB-completion completes too
much if there are non-ascii characters in file name. Here is a
simple recipe to demonstrate the problem:
(let ((default-directory temporary-file-directory))
(with-temp-file "pöytä-1.txt"
(insert "Pöytä is a Finnish word for table."))
(with-temp-file "pöytä-2.txt"
(insert "Other file."))
(file-name-completion "p" "."))
;; => "pöytä-1."
I expected the result to be "pöytä-" without "1.", since there
are two possible completions:
(directory-files temporary-file-directory nil "^p")
;; => ("pöytä-1.txt" "pöytä-2.txt")
This problem shows up when I try to find the file with C-x C-f:
C-x C-f /tmp/p TAB
completes to "/tmp/pöytä-1.". Second TAB completes
to "/tmp/pöytä-1.txt" and third displays "[sole completion]". I
expected the first TAB complete to "/tmp/pöytä-" and second TAB
to display two possible completions.
This happens on: GNU Emacs 23.0.60.6 (i686-pc-linux-gnu, GTK+
Version 2.12.9) of 2008-04-26 on arirop
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: nil
value of $LC_CTYPE: nil
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: nil
locale-coding-system: utf-8-unix
default-enable-multibyte-characters: t
--
Ari Roponen
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: File name completion problem with non-ascii file names
2008-04-27 10:36 File name completion problem with non-ascii file names Ari Roponen
@ 2008-04-27 16:16 ` Drew Adams
2008-04-27 18:07 ` Andreas Schwab
1 sibling, 0 replies; 6+ messages in thread
From: Drew Adams @ 2008-04-27 16:16 UTC (permalink / raw)
To: 'Ari Roponen', emacs-devel
> (let ((default-directory temporary-file-directory))
> (with-temp-file "pöytä-1.txt"
> (insert "Pöytä is a Finnish word for table."))
> (with-temp-file "pöytä-2.txt"
> (insert "Other file."))
> (file-name-completion "p" "."))
> ;; => "pöytä-1."
FWIW, on a January Windows build, this gives "p".
In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600)
of 2008-04-19 on LENNART-69DE564
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --no-opt --cflags -Ic:/g/include
-fno-crossjumping'
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: File name completion problem with non-ascii file names
2008-04-27 10:36 File name completion problem with non-ascii file names Ari Roponen
2008-04-27 16:16 ` Drew Adams
@ 2008-04-27 18:07 ` Andreas Schwab
2008-04-28 12:16 ` Ari Roponen
1 sibling, 1 reply; 6+ messages in thread
From: Andreas Schwab @ 2008-04-27 18:07 UTC (permalink / raw)
To: Ari Roponen; +Cc: emacs-devel
Ari Roponen <ari.roponen@gmail.com> writes:
> when I use C-x C-f to visit a file, TAB-completion completes too
> much if there are non-ascii characters in file name. Here is a
> simple recipe to demonstrate the problem:
>
> (let ((default-directory temporary-file-directory))
> (with-temp-file "pöytä-1.txt"
> (insert "Pöytä is a Finnish word for table."))
> (with-temp-file "pöytä-2.txt"
> (insert "Other file."))
> (file-name-completion "p" "."))
> ;; => "pöytä-1."
Should be fixed now.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: File name completion problem with non-ascii file names
2008-04-27 18:07 ` Andreas Schwab
@ 2008-04-28 12:16 ` Ari Roponen
2008-04-28 18:41 ` Andreas Schwab
0 siblings, 1 reply; 6+ messages in thread
From: Ari Roponen @ 2008-04-28 12:16 UTC (permalink / raw)
To: Andreas Schwab; +Cc: emacs-devel
Andreas Schwab <schwab@suse.de> writes:
> Ari Roponen <ari.roponen@gmail.com> writes:
>
>> when I use C-x C-f to visit a file, TAB-completion completes too
>> much if there are non-ascii characters in file name. Here is a
>> simple recipe to demonstrate the problem:
>>
>> (let ((default-directory temporary-file-directory))
>> (with-temp-file "pöytä-1.txt"
>> (insert "Pöytä is a Finnish word for table."))
>> (with-temp-file "pöytä-2.txt"
>> (insert "Other file."))
>> (file-name-completion "p" "."))
>> ;; => "pöytä-1."
>
> Should be fixed now.
>
> Andreas.
The problem I reported is indeed fixed. However, there is still a
minor problem:
(let ((default-directory temporary-file-directory)
(file "pöytä-1.txt"))
(with-temp-file file (insert "test file"))
(file-name-completion file default-directory))
;; => "pöytä-1.txt"
According to documentation, file-name-completion should return t,
because there is only one possible completion:
(directory-files temporary-file-directory nil "pöytä-1")
;; => ("pöytä-1.txt")
If there are no non-ascii characters in file name, everything
works fine:
(let ((default-directory temporary-file-directory)
(file "poyta-1.txt"))
(with-temp-file file (insert "test file"))
(file-name-completion file default-directory))
;; => t
This happens with GNU Emacs 23.0.60.10 (i686-pc-linux-gnu, GTK+
Version 2.12.9) of 2008-04-28 on arirop
--
Ari Roponen
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: File name completion problem with non-ascii file names
2008-04-28 12:16 ` Ari Roponen
@ 2008-04-28 18:41 ` Andreas Schwab
2008-04-29 10:17 ` Ari Roponen
0 siblings, 1 reply; 6+ messages in thread
From: Andreas Schwab @ 2008-04-28 18:41 UTC (permalink / raw)
To: Ari Roponen; +Cc: emacs-devel
Ari Roponen <ari.roponen@gmail.com> writes:
> According to documentation, file-name-completion should return t,
> because there is only one possible completion:
>
> (directory-files temporary-file-directory nil "pöytä-1")
> ;; => ("pöytä-1.txt")
Fixed.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-04-29 10:17 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-27 10:36 File name completion problem with non-ascii file names Ari Roponen
2008-04-27 16:16 ` Drew Adams
2008-04-27 18:07 ` Andreas Schwab
2008-04-28 12:16 ` Ari Roponen
2008-04-28 18:41 ` Andreas Schwab
2008-04-29 10:17 ` Ari Roponen
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.