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#62621: 29.0.60; uniquify can't make buffers unique based on things other than filename Date: Fri, 14 Jul 2023 09:29:38 +0300 Message-ID: <83edlb3t0t.fsf@gnu.org> References: <87bkgfjugn.fsf@catern.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18880"; mail-complaints-to="usenet@ciao.gmane.io" Cc: sbaugh@janestreet.com, 62621@debbugs.gnu.org To: sbaugh@catern.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 14 08:30:22 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 1qKCJp-0004iM-JD for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 Jul 2023 08:30:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qKCJZ-0006UO-NI; Fri, 14 Jul 2023 02:30:05 -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 1qKCJX-0006UA-Du for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2023 02:30:03 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qKCJX-0006eS-45 for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2023 02:30:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qKCJW-0002OG-Kx for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2023 02:30: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, 14 Jul 2023 06:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62621 X-GNU-PR-Package: emacs Original-Received: via spool by 62621-submit@debbugs.gnu.org id=B62621.16893161719124 (code B ref 62621); Fri, 14 Jul 2023 06:30:02 +0000 Original-Received: (at 62621) by debbugs.gnu.org; 14 Jul 2023 06:29:31 +0000 Original-Received: from localhost ([127.0.0.1]:41375 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKCJ1-0002N5-FQ for submit@debbugs.gnu.org; Fri, 14 Jul 2023 02:29:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41684) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKCIz-0002Mq-3Y for 62621@debbugs.gnu.org; Fri, 14 Jul 2023 02:29:30 -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 1qKCIs-0006Wo-5V; Fri, 14 Jul 2023 02:29:22 -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=NtVQudwRVoEpLCyfvNvMkTADGHZvg+NtmFAoLkgQaEU=; b=Hhb1QoTnCIFX 3d1qtEd1q1oZLghCUqdj3Yw71FBtJBnCjij6qrsWPBOFevy++13S4PAmOev8Y31ThM3odFN4a4r4q WAva/SQW/FcdeQQTcEyhTFkxuRRAKZXaJ19cUbt4xFuLMVgKxfwcKH3wPy7YdCjJhab/firNHmLMI ANbXeXzg1iJOJQSAAFS06PPOAUvLgr+Xrg/zim6GoXpO7ODI/9DrCAV8WmzkOjXTqU+QuQ5oGlhod RPZKihF0zJb7vbfSIaX9gVjoD7+OlIXRIQk5RCJ/m1aMQCQRL/JRVvtO3lXvrUGpYCOodQQYoAQKI zQCXxnamocZhV2jr5K73Sg==; 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 1qKCIr-00007v-Hp; Fri, 14 Jul 2023 02:29:21 -0400 In-Reply-To: <87bkgfjugn.fsf@catern.com> (sbaugh@catern.com) 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:265071 Archived-At: > Cc: 62621@debbugs.gnu.org > From: sbaugh@catern.com > Date: Thu, 13 Jul 2023 22:51:53 +0000 (UTC) > > I've thought quite a bit about how to make this configurable, and I > think just letting people write their own arbitrary transformation > functions, as I do in this patch, is what we should provide. Making > things any more modular is fairly difficult. Packages can come along > and provide other fancy functions if they like. If there are a couple of simpler alternatives which could be offered via simple symbolic values, we should not force everyone to write functions, IMNSHO. IOW, we should NOT immediately generalize to functions only because such generalization could make sense in some use cases. Repeat after me: Use options whose values are functions are hard on our users, because they require them to be Lisp programmers. > +(defcustom uniquify-dirname-transform #'identity > + "A function to transform the dirname used to uniquify a buffer. "Function to transform buffer's `default-directory' for uniquifying its name." > +It takes a single argument: the directory of the buffer. It > +should return a string filename (which does not need to actually > +exist in the filesystem) to use for uniquifying the buffer name." > + :type '(choice (function-item :tag "Don't change the dirname" identity) > + function) > + :group 'uniquify) The :version tag is missing. Also, the doc string should state that the default is to use the buffer's default-directory without any transformations. It should also include a link to uniquify-buffer-file-name, so that users could consult the uniquify facilities if they need to. Thanks.