GNU bug report logs - #58835
28.1; try-complete-file-name-partially modifies text before point

Previous Next

Package: emacs;

Reported by: Anders Munch <ajm <at> flonidan.dk>

Date: Fri, 28 Oct 2022 12:32:02 UTC

Severity: normal

Tags: notabug, wontfix

Found in version 28.1

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #18 received at 58835-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Anders Munch <ajm <at> flonidan.dk>, 58835-done <at> debbugs.gnu.org
Subject: Re: bug#58835: 28.1; try-complete-file-name-partially modifies text
 before point
Date: Sat, 2 Sep 2023 09:43:09 -0700
Eli Zaretskii <eliz <at> gnu.org> writes:

> tags 58835 notabug wontfix
> thanks
>
>> When hippie-expand uses try-complete-file-name-partially on a partial
>> path which uses platform standard directory separators, then directory
>> separators are replaced with posix directory separators throughout the
>> entire path.
>>
>> Functions that "expand" or "complete" should not change text before
>> point.
>
> In general, yes.  But I see no reason to expect that with 110%
> certainty in all cases, especially on MS-Windows.
>
>> For example, when expanding
>>     c:\Documents
>> it becomes
>>     c:/Documents and settings/
>>
>> Expected behaviour: Nothing changed before point, expand to:
>>     c:\Documents and settings/
>
> This is a non-starter, sorry.  Emacs converts backslashes in Windows
> file names to forward slashes at the first opportunity, and it does
> that for very good reasons: to allow comparison of file names as
> (almost) simple strings, and to avoid causing problems in code that
> may not expect backslashes in file names.  This is why Emacs does this
> conversion in expand-file-name, which is generally called before a
> file name is passed to some C library function.  It does that also
> when you call the completion commands -- again, to simplify textual
> comparison of completion candidates.

I'm therefore closing this bug report.




This bug report was last modified 1 year and 261 days ago.

Previous Next


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