From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" 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: Mon, 10 Jul 2023 12:53:00 -0400 Message-ID: References: <87h6tpn8d5.fsf@catern.com> <87edotn7sx.fsf@catern.com> <87edlhm6wq.fsf@catern.com> <87o7kklf9c.fsf@catern.com> <83r0pf9b7d.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37703"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: sbaugh@catern.com, 62732@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 10 18:54:39 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 1qIu9n-0009eC-4k for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Jul 2023 18:54:39 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qIu9L-000684-A5; Mon, 10 Jul 2023 12:54:11 -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 1qIu9D-00066C-L6 for bug-gnu-emacs@gnu.org; Mon, 10 Jul 2023 12:54: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 1qIu9C-0006Po-Bv for bug-gnu-emacs@gnu.org; Mon, 10 Jul 2023 12:54:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qIu9B-00007K-N7 for bug-gnu-emacs@gnu.org; Mon, 10 Jul 2023 12:54:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Jul 2023 16:54:01 +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.1689007994362 (code B ref 62732); Mon, 10 Jul 2023 16:54:01 +0000 Original-Received: (at 62732) by debbugs.gnu.org; 10 Jul 2023 16:53:14 +0000 Original-Received: from localhost ([127.0.0.1]:49031 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIu8Q-00005m-GG for submit@debbugs.gnu.org; Mon, 10 Jul 2023 12:53:14 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:32277) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIu8O-00005Y-Gj for 62732@debbugs.gnu.org; Mon, 10 Jul 2023 12:53:13 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id D04BA4417FA; Mon, 10 Jul 2023 12:53:06 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id E42384417E0; Mon, 10 Jul 2023 12:53:00 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1689007980; bh=kCeA65A+kv9Aja9NQRKz/FtR7YZKPUtgehOvgIsLKOo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=nL155+Mjc1FxafxhrYixFS5JmjlhVkBRQWkDmLsC/VAEN/a05XEnqUewNv+p3Nunm VaM8DllVDbdENts3Vat2bTA6odotMRD/NF7AtsgbFo9ifCp6td4/SpQxCYaHoScNLW vHX5k1jkjLQl5CUXuKLlSO1cjN8/6an6kmKcfbQ6k8TKivrhMANTZ++ZGBqH9k5R3S GPMwd7A7zo7vhspvGKsVxMnJpQHbHYSLdnf33TfQOoQ8koFE9uDzoEN6XC5Mm8If3o EWvG2wfkrZ3Nno3FXR4lPzJ3iIdEYxE6X+tVZLXgewSRLER28//wYG4AXIYHnAkjjP x19Obt6660vfg== Original-Received: from pastel (unknown [24.140.234.50]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id B9415120330; Mon, 10 Jul 2023 12:53:00 -0400 (EDT) In-Reply-To: <83r0pf9b7d.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 10 Jul 2023 15:56:38 +0300") 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:264894 Archived-At: >> --- a/lisp/dired.el >> +++ b/lisp/dired.el >> @@ -1306,7 +1306,7 @@ dired-internal-noselect >> ;; Note that buffer already is in dired-mode, if found. >> (new-buffer-p (null buffer))) >> (or buffer >> - (setq buffer (create-file-buffer (directory-file-name dirname)))) >> + (setq buffer (create-file-buffer dirname))) > > This seems to imply that callers of create-file-buffer will now have > to remember to ensure the argument ends in a slash if it is the name > of a directory. Which callers are you thinking of? I think the fact that the callers get to control this regardless of whether there is a file or directory by that name is one of the best part of this change. > If so, I'd prefer that create-file-buffer did that internally, when > its argument is a directory. What would be the benefit? > Callers shouldn't know to much about the internals of the callee. Indeed: currently `create-file-buffer` doesn't pay attention to the file system at all, it just creates a buffer with a name based on the FILENAME that's passed. Spencer's patch just offers more control to the callers by making `create-file-buffer` respect the choice of the callers (whether they used a file name or a dire name, which is an important distinction in Emacs's file name APIs, not just here). There's no need for the callers to know about the internals of the callee. If they call `create-file-buffer` with /foo/bar/baz the buffer will be called "baz" and if they call it with /foo/bar/baz/ the buffer will be called "baz/" (depending on `uniquify-trailing-separator-p`, of course). It's the most natural/obvious semantics. Stefan