From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#41821: 28.0.50; read-directory-name in vc commands should provide defaults from projects Date: Fri, 3 Jul 2020 16:13:49 +0300 Message-ID: References: <87r1ulxk48.fsf@mail.linkov.net> <878sge7jls.fsf@mail.linkov.net> <7e136435-7123-fa42-e4a8-66b82e6595da@yandex.ru> <87pn9pxris.fsf@mail.linkov.net> <83d05ottnw.fsf@gnu.org> <0b42f540-f779-446b-4411-8dae3a50d09d@yandex.ru> <837dvwtrv1.fsf@gnu.org> <835zbgtqps.fsf@gnu.org> <625de669-0715-1467-0bd1-84328b4bee5f@yandex.ru> <83wo3ws4g8.fsf@gnu.org> <83tuyzs2np.fsf@gnu.org> <87h7uuj1v3.fsf@mail.linkov.net> <87h7utjx75.fsf@mail.linkov.net> <3f9e85ba-66a9-abd0-61bf-800ea8bb4ee3@yandex.ru> <87eepw5nlt.fsf@mail.linkov.net> <83v9j7xpoj.fsf@gnu.org> <990a9046-c4e6-efb2-01dd-60198994127b@yandex.ru> <831rluxcll.fsf@gnu.org> <83r1ttx196.fsf@gnu.org> <9c09977f-18c2-facd-c1e2-e7fe488ee92c@yandex.ru> <83eeptw3a9.fsf@gnu.org> <5eef9982-091d-5db6-d96f-35da1f2cf42d@yandex.ru> <833668x1jc.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2815"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 Cc: 41821@debbugs.gnu.org, juri@linkov.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 03 15:18:55 2020 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 1jrLag-0000d6-8k for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 03 Jul 2020 15:18:54 +0200 Original-Received: from localhost ([::1]:49372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jrLaf-00060x-5v for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 03 Jul 2020 09:18:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43764) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jrLWw-0000Cp-3D for bug-gnu-emacs@gnu.org; Fri, 03 Jul 2020 09:15:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45091) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jrLWv-0007nv-QI for bug-gnu-emacs@gnu.org; Fri, 03 Jul 2020 09:15:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jrLWv-0005Vh-Lb for bug-gnu-emacs@gnu.org; Fri, 03 Jul 2020 09:15:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 Jul 2020 13:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41821 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 41821-submit@debbugs.gnu.org id=B41821.159378204221099 (code B ref 41821); Fri, 03 Jul 2020 13:15:01 +0000 Original-Received: (at 41821) by debbugs.gnu.org; 3 Jul 2020 13:14:02 +0000 Original-Received: from localhost ([127.0.0.1]:56637 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jrLVx-0005UE-TY for submit@debbugs.gnu.org; Fri, 03 Jul 2020 09:14:02 -0400 Original-Received: from mail-wm1-f44.google.com ([209.85.128.44]:55666) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jrLVt-0005TX-Ld for 41821@debbugs.gnu.org; Fri, 03 Jul 2020 09:14:00 -0400 Original-Received: by mail-wm1-f44.google.com with SMTP id g75so31974107wme.5 for <41821@debbugs.gnu.org>; Fri, 03 Jul 2020 06:13:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=c+c5eDtJvYxJQXu9fKRTEQozoyh9nX3nNM+iF6L1LtI=; b=TUaSpROoQlhAploFNBGhf91V+E/huz6eDiOfQun4VeIBlXT0c98oOAbGZ6WllyZ646 cMkXucPS3I9pRCSlsrQhbL+RTDezN/tZOc89oF6XKiD3V6JVgqWNAkQqlkdql+40RVa7 9NTDb8plTgHe0YTbpZKx03GcIbjjSKvqDra+E4vLexFLQBnLGBtSA/rkcnoaAxEpF4Kt xTY4AwPeI8mKdCX+97WqgqrBAalhwuPlRszr65fGgiM9rL0alnINl4+Csuu9ClWoqf3u hoMKSQgDCb7bwthJVViwN2As4ot1aYVRkzdRzXorJ7KatanXf4V0OYLopxGGXMpIVoia iOZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=c+c5eDtJvYxJQXu9fKRTEQozoyh9nX3nNM+iF6L1LtI=; b=TCpR4bCJmf66n4a3Q6u3TU41zSv233Vjp73ZK+veYJkrIa8tHvyY8+KXnO+hei2nJb 8Aov9fFqzkFdj+ouN9rKmfeg3YAd/jGU1dHEaehe3KAoZvcXLW8D45R2pEAw+XhcyG92 1xdpvq0SQsznPSnwpKaIvATCDfZWiRpkS6nsguvCxJH7Z5neSVhWT4Q5tHoBJqnJGuZQ mSYqskfyp88AatlIVhGDH5RdammiAPZG9aEtXk46ila65cmGrjkj4UhwSlLZt3f6dv9P ZbPZiu4P8qBrIXCGT2f2hBVUMwW6TQ336Hs5rnC682vCOC3Xb7Y7gZ70K7buM3/CRgQ+ Z2ug== X-Gm-Message-State: AOAM530NI3tF/ub7/S8QYGLyvTVv3Ah4vkJCbmWTjOSbwvdK7HiJXSCp +iyRNUs1+qZL9zuRPQC8mh4= X-Google-Smtp-Source: ABdhPJywGcAjSmks+W8NZpNp2oQarwC0H5TxmXo7SAKVd+s4D18b09VYC2o5XoykErs0c/bHnq7w2Q== X-Received: by 2002:a05:600c:2116:: with SMTP id u22mr35960218wml.82.1593782031739; Fri, 03 Jul 2020 06:13:51 -0700 (PDT) Original-Received: from [192.168.0.35] ([109.110.245.170]) by smtp.googlemail.com with ESMTPSA id 190sm1664180wmb.15.2020.07.03.06.13.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 Jul 2020 06:13:50 -0700 (PDT) In-Reply-To: <833668x1jc.fsf@gnu.org> Content-Language: en-US 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" Xref: news.gmane.io gmane.emacs.bugs:182663 Archived-At: On 03.07.2020 14:48, Eli Zaretskii wrote: >> Cc: 41821@debbugs.gnu.org, juri@linkov.net >> From: Dmitry Gutov >> Date: Fri, 3 Jul 2020 13:23:05 +0300 >> >>> You assume that most users don't know about or use M-n? I do it all >>> the time, and would like to think others do as well. >> >> I assume, yes. >> >> But even if they do, I'm not sure how this extra capability could harm them. > > ??? Offering incorrect default doesn't cause harm? Offering known project roots directories would be incorrect? >>>> If an xref backend doesn't define the xref-backend-references method, >>>> the alternative is no references at all. >>> >>> The alternative could be to start with the current directory, or ask >>> the user. >> >> Using the current directory will result in worse results almost always, > > Worse than searching unrelated directories? Worse than the current behavior. And either way, using just the current directory will almost always result in *missing* valid references from the results. That's much worse than including some irrelevant results, potentially. > Perhaps you are thinking > about the use case where the project-related directories are indeed > relevant to the search. I was thinking about the opposite use case. I'm not sure about the totality of the use cases that would be helped or harmed by the current approach. But I have yet to see a single user complain about the current behavior. >> IME. Prompting the user every time is not a great experience either. > > Not every time, only the first time. Afterwards, the user has the > history. They can only input one directory this way. A project can include "external roots". >>> But do we have xref backends that don't define the >>> xref-backend-references method? If so, which ones don't? >> >> Neither of the built-in ones does. :-) > > But currently, they don't offer project-related defaults, do they? At > least not in released versions of Emacs. What do you mean? Doesn't 'M-x xref-find-references' work for you? This situation has been in place for ~5 years now. >>> "Imperfect" and "completely wrong" is not the same at all. Searching >>> the wrong directory hierarchy will get you the latter. >> >> Perhaps. To get better results, the user will have to set up the project >> configuration better. > > Like what? Like using a project backend that would describe the locations of their source files better. > I don't think I understand how project configuration could > help in non project-related searches. And you lost me here. xref backend doesn't equal a project backend, but you can't claim they are entirely unrelated either (from the user's point of view), or that their configurations don't correlate heavily.