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 15:01:58 +0300 Message-ID: <83h6q6g0qx.fsf@gnu.org> References: <87bkgfjugn.fsf@catern.com> <83edlb3t0t.fsf@gnu.org> <878rbika0i.fsf@catern.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11014"; 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 14:02:26 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 1qKHVC-0002eA-8Q for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 Jul 2023 14:02:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qKHUv-0006Q5-6S; Fri, 14 Jul 2023 08:02:09 -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 1qKHUp-0006JN-6B for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2023 08:02:08 -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 1qKHUo-0005hT-PP for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2023 08:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qKHUo-0005sv-4n for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2023 08:02: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 12:02: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.168933611722609 (code B ref 62621); Fri, 14 Jul 2023 12:02:02 +0000 Original-Received: (at 62621) by debbugs.gnu.org; 14 Jul 2023 12:01:57 +0000 Original-Received: from localhost ([127.0.0.1]:41569 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKHUf-0005sY-DG for submit@debbugs.gnu.org; Fri, 14 Jul 2023 08:01:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57024) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKHUc-0005sK-J2 for 62621@debbugs.gnu.org; Fri, 14 Jul 2023 08:01:51 -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 1qKHUW-0005X9-GZ; Fri, 14 Jul 2023 08:01:44 -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=jQ0Sy2SrQS7Sql6G+kkdTihAvJzNmwaP4bYT7UHydqM=; b=b0gjNMXv1hn4 rBt8L+Q9axMpYncVspBKfRSE9ElbPw4ifGjuThYhXgF4wltV5Qp2AgkPgZBa68nsEik6EDX0kMZXj 4+xhFWg+MO19T92jw7IxFYyHYJccSo5BdXe3QWBl5MI2mzY5MPpFRMh5qCfePixCWLVm1vZ2CaNgh 19UKz9ykefaBfMQeQ75vtjRF6wkcMmRXKOtHoFhPrbgu4Q5PLXvGf9jxPTGwLTLnZRy8KUyhsSrRF /LIrbupm1sQS1f3E3plB7cux1jEhEar2zYGulafh3PyQ6y4JVGDSotKI443mp+clANnmQjya6pQM5 92olJhi+2zsDpr5Fb0uUWw==; 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 1qKHUR-0000GP-Mv; Fri, 14 Jul 2023 08:01:44 -0400 In-Reply-To: <878rbika0i.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:265085 Archived-At: > From: sbaugh@catern.com > Date: Fri, 14 Jul 2023 11:28:13 +0000 (UTC) > Cc: sbaugh@janestreet.com, 62621@debbugs.gnu.org > > Eli Zaretskii writes: > > > 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. > > I agree, and I'm happy to change it to use a simple symbolic value > 'project instead for the transform I wrote, but I'm not sure how best to > handle the dependencies: uniquify.el is in loadup.el, is it OK for it to > rely on project-uniquify-dirname-transform being autoloaded? I don't understand the difficulty. If the function value could be defined in uniquify.el, why cannot a symbolic value be defined there? If the symbolic values are specific to project, simply let-bind uniquify-dirname-transform to the value of the appropriate project.el defcustom when project.el calls uniquify. > >> +(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." > > Unfortunately, this isn't quite right. uniquify never uses > default-directory, counterintuitively - by default, it uses the > directory of buffer-file-name, which can differ from default-directory. That's a minor issue, just use "buffer's directory" instead. But I wonder why uniquify does something counterintuitive like that.