From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#70996: project-find-file defaults Date: Tue, 11 Jun 2024 19:58:53 +0300 Organization: LINKOV.NET Message-ID: <86bk47zbne.fsf@mail.linkov.net> References: <867cft2ggx.fsf@mail.linkov.net> <86cyoqjdcq.fsf@mail.linkov.net> <67beb5e6-8e74-4320-ba2f-7ceca2aae963@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35980"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: 70996@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 11 19:10:29 2024 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 1sH50v-0009Ax-Ic for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 11 Jun 2024 19:10:29 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sH50Z-0001YE-5d; Tue, 11 Jun 2024 13:10:07 -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 1sH50W-0001WJ-8G for bug-gnu-emacs@gnu.org; Tue, 11 Jun 2024 13:10:04 -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 1sH50W-00037t-0v for bug-gnu-emacs@gnu.org; Tue, 11 Jun 2024 13:10:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sH50U-0005t8-9M for bug-gnu-emacs@gnu.org; Tue, 11 Jun 2024 13:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Jun 2024 17:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70996 X-GNU-PR-Package: emacs Original-Received: via spool by 70996-submit@debbugs.gnu.org id=B70996.171812579622608 (code B ref 70996); Tue, 11 Jun 2024 17:10:02 +0000 Original-Received: (at 70996) by debbugs.gnu.org; 11 Jun 2024 17:09:56 +0000 Original-Received: from localhost ([127.0.0.1]:36176 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sH50O-0005sV-A2 for submit@debbugs.gnu.org; Tue, 11 Jun 2024 13:09:56 -0400 Original-Received: from relay2-d.mail.gandi.net ([217.70.183.194]:37207) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sH50M-0005s5-8s for 70996@debbugs.gnu.org; Tue, 11 Jun 2024 13:09:55 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 1B99040004; Tue, 11 Jun 2024 17:09:25 +0000 (UTC) In-Reply-To: <67beb5e6-8e74-4320-ba2f-7ceca2aae963@gutov.dev> (Dmitry Gutov's message of "Tue, 11 Jun 2024 03:02:01 +0300") X-GND-Sasl: juri@linkov.net 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:287101 Archived-At: >> The reason of this change to make the first item of the M-n list >> more deterministic: > > Okay, now I see that line, thanks. > >> 1. when there is no thing-at-point, then the first item will be >> buffer-file-name; >> 2. and also when there is a thing-at-point, the first item >> will remain buffer-file-name. >> Otherwise, it was too unpredictable: after typing 'M-n RET' >> to use buffer-file-name, it often did a wrong thing >> when point happened to stay in a thing-at-point. > > Okay, but I'm not sure predictability must be the overriding principle. > > If 10 people use the thing-at-point default, for example, and only 2 use > the buffer-file-name default (or, say, the number of users is the same, but > the frequency is higher for the latter), we'd be forcing a lot of people to > press C-n to jump over the default they don't use. > > What's the main usage scenario for the buffer-file-name default? I recall > Spencer describing his workflow, but that seems only useful when you have > a lot of branches, checked out specifically into worktrees or similar, and > switch between them often (while explicitly staying in the "same" file > during a switch). Do you do something similar? I recall Spencer mentioned that 'C-x p f M-n' is the quickest way getting a file name relative to the project root for using it for external references. And I use the same case very often too. (I mean the case of '(project--find-default-from buffer-file-name pr)'). OTOH, thing-at-point is too specific to a programming language, and can be used to navigate source code by placing point on an "include" directive with relative a file name, then 'C-x p f M-n M-n' will help to find the referenced file. This is a poor man's way for source code navigation, since 'M-.' doesn't support navigation by project relative file names.