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#62732: 29.0.60; uniquify-trailing-separator-p affects any buffer whose name matches a dir in CWD Date: Wed, 12 Jul 2023 16:42:01 +0300 Message-ID: <83y1jl5jrq.fsf@gnu.org> References: <87h6tpn8d5.fsf@catern.com> <87edotn7sx.fsf@catern.com> <87edlhm6wq.fsf@catern.com> <87o7kklf9c.fsf@catern.com> <83r0pf9b7d.fsf@gnu.org> <83fs5v8tsw.fsf@gnu.org> <83edlf89qp.fsf@gnu.org> <83v8eq7j3i.fsf@gnu.org> <83pm4y79dw.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4661"; mail-complaints-to="usenet@ciao.gmane.io" Cc: sbaugh@janestreet.com, 62732@debbugs.gnu.org, sbaugh@catern.com To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 12 15:43:21 2023 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 1qJa7k-0000xZ-2y for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 12 Jul 2023 15:43:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qJa7U-00027q-VQ; Wed, 12 Jul 2023 09:43:04 -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 1qJa7T-00023A-2i for bug-gnu-emacs@gnu.org; Wed, 12 Jul 2023 09:43:03 -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 1qJa7S-0001JY-RS for bug-gnu-emacs@gnu.org; Wed, 12 Jul 2023 09:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qJa7S-0007pg-6Q for bug-gnu-emacs@gnu.org; Wed, 12 Jul 2023 09:43: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: Wed, 12 Jul 2023 13:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62732 X-GNU-PR-Package: emacs Original-Received: via spool by 62732-submit@debbugs.gnu.org id=B62732.168916933630049 (code B ref 62732); Wed, 12 Jul 2023 13:43:02 +0000 Original-Received: (at 62732) by debbugs.gnu.org; 12 Jul 2023 13:42:16 +0000 Original-Received: from localhost ([127.0.0.1]:51947 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJa6i-0007ob-3m for submit@debbugs.gnu.org; Wed, 12 Jul 2023 09:42:16 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:59564) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJa6f-0007oO-Cy for 62732@debbugs.gnu.org; Wed, 12 Jul 2023 09:42:14 -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 1qJa6U-000148-A4; Wed, 12 Jul 2023 09:42:04 -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=EaayxoCpNRlLhPGthskhyBbQVZqQ0uvnLPgmFyzWwPQ=; b=aqlINd/SyV5v I74SE0G6jRe9eRnbWvTA2MzmvVgUK3Rbb93p7WLK4bBMr2Lm1VXg+DbuROuruczWtXFEaWpCPelby dygGGJRf6M4KMrM2Xz5WgSR8UKwbc9RwYtP89utSd+ggY5yUeuTfnrI41Y23M5mUN2gTU8Wfu+GbU HLGqpMw2Sl58vKK0c+oqGM6GvTqctxhWuBRs7DNGDxvSPXZ/453APW03n6dQuRRmnx/TfWF+MDhdI KjwbMP4W2Lg59twfbWwBogWqHYhFvPpXAXluRl8kAHUi79xOwub1Xd4xvuoJ785F49VIWspsM+BcU zSWK3CvjEd8y+1+0pGpP9w==; 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 1qJa6F-0006d1-T1; Wed, 12 Jul 2023 09:41:55 -0400 In-Reply-To: (message from Stefan Monnier on Wed, 12 Jul 2023 09:04:40 -0400) 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:264963 Archived-At: > From: Stefan Monnier > Cc: Spencer Baugh , sbaugh@catern.com, > 62732@debbugs.gnu.org > Date: Wed, 12 Jul 2023 09:04:40 -0400 > > I'm not sure what to make of this discussion. > > The issue at hand is the following: `create-file-buffer` needs to know > if the filename it receives is for a directory or not so it can decide > whether the buffer name should end in / or not according to > `uniquify-trailing-separator-p`. > > I can see 3 ways to provide this info: > > 1- use `file-directory-p`. > 2- add a boolean `directory` argument to `create-file-buffer`. > 3- use the presence of a trailing directory separator in the filename. > > Those 3 are very close to each other, in practice, so we're pretty much > in bikeshed territory. > > My preference is (3) first, (2) second, and (1) last. I prefer (1), because it avoids requesting the callers to remember to ensure that every directory ends in a slash. The trailing-slash semantics is indeed pretty much standard, but only in interactive usage (where it is made easier by the file-name completion machinery, both in Emacs and in other programs that ask users to type file names). And even in interactive usage it is problematic: recall the many complaints when we started requiring the slash in copy-file and such likes. Here we are talking about a low-level function, not an interactive command, which then places this burden on the callers, and I worry that many of them will not pay attention to this subtlety, and will cause subtle bugs, because AFAIK the uniquify modes where that is important are rarely used, and thus such problems could go undetected for many years.