From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#58835: 28.1; try-complete-file-name-partially modifies text before point Date: Fri, 28 Oct 2022 16:18:31 +0300 Message-ID: <83czacjdco.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16833"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58835@debbugs.gnu.org To: Anders Munch Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 28 15:20:04 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ooPHH-00049z-T5 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 28 Oct 2022 15:20:04 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ooPGl-0007i7-71; Fri, 28 Oct 2022 09:19:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ooPGI-0007Z0-Us for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 09:19:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ooPGI-0004g5-NC for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 09:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ooPGI-0007Gn-Bi for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 09:19: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, 28 Oct 2022 13:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58835 X-GNU-PR-Package: emacs Original-Received: via spool by 58835-submit@debbugs.gnu.org id=B58835.166696312827918 (code B ref 58835); Fri, 28 Oct 2022 13:19:02 +0000 Original-Received: (at 58835) by debbugs.gnu.org; 28 Oct 2022 13:18:48 +0000 Original-Received: from localhost ([127.0.0.1]:60671 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooPG3-0007GD-NH for submit@debbugs.gnu.org; Fri, 28 Oct 2022 09:18:48 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33324) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooPFy-0007Fu-PC; Fri, 28 Oct 2022 09:18:46 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ooPFs-0004er-U1; Fri, 28 Oct 2022 09:18:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=85mrmD1Fjqop/gTMBH0vyO6dWoB5TJlkDHRYvfrZNCU=; b=FiXv23K3EzWq YpG9c5dusGWRWtbwzV+yhcmf97e+FZvkv9BE12nyVkr1NplqHQfmaJMguKoSEwMbsDDM8MW8iZxva VXybOhBK5SBBHFwohg7qmEV0SqmCfmPbYbSgndSmS9ih8CUgMx+7r08d9kpl5HNrbhjja+VlQ31tG mahKl7GTnxbaRnQl1WfBj5X42C4jzcf3i1zbiVb+WRLQyHgkhryHSEo1ljISn9o05ZOrO1auFA7cv Pn/ELCZ/GEbUWtBAHAqQ2ykfdcOkQbKBygsJps0HdfiXjH8BbFvCHno5kJy6M984hpkDemzDFinOO UipMvU03kkCOsEbaVGt8aA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ooPFr-0002lJ-9R; Fri, 28 Oct 2022 09:18:36 -0400 In-Reply-To: (message from Anders Munch on Thu, 27 Oct 2022 08:35:51 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246425 Archived-At: tags 58835 notabug wontfix thanks > From: Anders Munch > Date: Thu, 27 Oct 2022 08:35:51 +0000 > > 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. > Desired behaviour is to respect platform conventions and produce > c:\Documents and settings\ > but I realise that would be too much to ask. Indeed. May I ask what is the real-life situation where this slash conversion caused you trouble?