From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: sbaugh@catern.com 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 11:28:13 +0000 (UTC) Message-ID: <878rbika0i.fsf@catern.com> References: <87bkgfjugn.fsf@catern.com> <83edlb3t0t.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38087"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: sbaugh@janestreet.com, 62621@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 14 13:29:31 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 1qKGzK-0009jA-9O for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 Jul 2023 13:29:31 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qKGyv-0007VA-At; Fri, 14 Jul 2023 07:29: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 1qKGyt-0007Uh-3X for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2023 07:29: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 1qKGys-0004iU-Rx for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2023 07:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qKGys-0002V7-8r for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2023 07:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: sbaugh@catern.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 Jul 2023 11:29: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.16893341019554 (code B ref 62621); Fri, 14 Jul 2023 11:29:02 +0000 Original-Received: (at 62621) by debbugs.gnu.org; 14 Jul 2023 11:28:21 +0000 Original-Received: from localhost ([127.0.0.1]:41553 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKGyD-0002U2-CL for submit@debbugs.gnu.org; Fri, 14 Jul 2023 07:28:21 -0400 Original-Received: from s.wrqvwxzv.outbound-mail.sendgrid.net ([149.72.154.232]:24500) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKGyB-0002Tq-At for 62621@debbugs.gnu.org; Fri, 14 Jul 2023 07:28:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catern.com; h=from:subject:in-reply-to:references:mime-version:to:cc:content-type: content-transfer-encoding:cc:content-type:from:subject:to; s=s1; bh=0NS7kmnE9Eh+LJQVcwdlt9eukrEWyeg9ocLimQut0zI=; b=fPABbRnrwHsMcJYpa0d8nlhh9QPeldXqnoVn5yw5tmlhHLSrsfPs+0UVHQxrM0aBNT1p A+zFSdeDwj9urnJ3+P1O7MGM+7yqrFXm3csjuF5Uj3BmU7tUtpBCelXAbGjZiAwdDCl0Nm QqEtBbV+oSb7pKv33uaYSolTzjUFvdFcTS1hvRr64fyOhkn03Tcx6TVt+4N19Z04EtYLiJ YtDeqfUvJdt/8pr0iQ1SBh0d13GbwquNnTe5EVWAFwCZB1jlVxfvBOa8yirJCTXQdfD7ko aLckrtwuNFTgUu2zyRg8GgYaKy1ZtFLbfZ4RHVDyUopTwY/vXMrsosF7k4iIZ4Hw== Original-Received: by filterdrecv-66949dbc98-5ngqz with SMTP id filterdrecv-66949dbc98-5ngqz-1-64B1314D-3E 2023-07-14 11:28:13.806860986 +0000 UTC m=+5572100.012180766 Original-Received: from earth.catern.com (unknown) by geopod-ismtpd-17 (SG) with ESMTP id 9WXds7hwQ-aTiMFr0xfMQQ Fri, 14 Jul 2023 11:28:13.723 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost; envelope-from=sbaugh@catern.com; receiver=gnu.org Original-Received: from localhost (localhost [IPv6:::1]) by earth.catern.com (Postfix) with ESMTPSA id 439B36015A; Fri, 14 Jul 2023 07:28:13 -0400 (EDT) In-Reply-To: <83edlb3t0t.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 14 Jul 2023 09:29:38 +0300") X-SG-EID: ZgbRq7gjGrt0q/Pjvxk7wM0yQFRdOkTJAtEbkjCkHbKhmPFO2bOv8z2OPgy3whloo146+vvWaLq54tPmHwdGf99zgAk1uJvMxBd2580QqjDosBa4+AaxSRMsFfrutsxxf3X7jCN+0m4vWGznGSFnN0r5hdkgMQQUSqaN+B3txwLa+jCjaNUdSGDE/baCbFsaC6lsmd9gUiW9cGnTl8GUSw== X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== 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:265082 Archived-At: Eli Zaretskii writes: >> 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. 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? >> +(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. >> +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. Will include that in the next version.