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#45135: 28.0.50; [PATCH] Add option to print file names in *xref* buffer relative to project root Date: Wed, 30 Dec 2020 14:05:24 +0200 Message-ID: <8194ba8f-b700-9375-f2b6-0a96d501e621@yandex.ru> References: <6d6911b9-c604-1fca-3cd4-084a8880524f@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31176"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 Cc: 45135-done@debbugs.gnu.org To: Tobias Rittweiler Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 30 13:06:23 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 1kuaFD-0007yf-Dm for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 30 Dec 2020 13:06:23 +0100 Original-Received: from localhost ([::1]:54572 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kuaFB-0003Pr-Rc for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 30 Dec 2020 07:06:21 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51974) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kuaEs-0003PD-GT for bug-gnu-emacs@gnu.org; Wed, 30 Dec 2020 07:06:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58728) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kuaEs-0005MK-0K for bug-gnu-emacs@gnu.org; Wed, 30 Dec 2020 07:06:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kuaEr-0000b4-RQ for bug-gnu-emacs@gnu.org; Wed, 30 Dec 2020 07:06:01 -0500 Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Wed, 30 Dec 2020 12:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 45135 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Mail-Followup-To: 45135@debbugs.gnu.org, dgutov@yandex.ru, trittweiler@gmail.com Original-Received: via spool by 45135-done@debbugs.gnu.org id=D45135.16093299342249 (code D ref 45135); Wed, 30 Dec 2020 12:06:01 +0000 Original-Received: (at 45135-done) by debbugs.gnu.org; 30 Dec 2020 12:05:34 +0000 Original-Received: from localhost ([127.0.0.1]:42039 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kuaEQ-0000aB-Lu for submit@debbugs.gnu.org; Wed, 30 Dec 2020 07:05:34 -0500 Original-Received: from mail-wm1-f44.google.com ([209.85.128.44]:40937) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kuaEP-0000Zv-Ap for 45135-done@debbugs.gnu.org; Wed, 30 Dec 2020 07:05:34 -0500 Original-Received: by mail-wm1-f44.google.com with SMTP id r4so4559364wmh.5 for <45135-done@debbugs.gnu.org>; Wed, 30 Dec 2020 04:05:33 -0800 (PST) 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=qdbScoX5TQNEGewYr3bZX/OrKvlSYXJMvaFBSaZOFi8=; b=APlGd5qAPwhVafWoNiQVDAPhb7IgJXQyJujnvdh85SooFT2EI2/3JPa1136Tv6EpOg BOtMG0LrLX5HL6MIo7vVr4Kb0LHC8rgD/cc8GjuDLaCPUVEdaRr7QkQi0ca8EkthvmNd RVUs0A6h1+AUYmMO5PIVTCu1z4zJAKhN/9VORLetioohBUeNy73VttrBEqwR8KaJdLAp 3GF3Gqdd9D4mNwwjkt+tnEv60sQyfdyCvzU9odQO8tObNujYms0K6OKcP4g4wVrOMtJ2 ljqoVSNiIVK6/4+HLQsXYZLPTZFyRCm3/uur5yPQji6HccJUUEJsLv4y7hrNLLDcoIsp CY7g== 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=qdbScoX5TQNEGewYr3bZX/OrKvlSYXJMvaFBSaZOFi8=; b=paqVk2qGQixdboKaN+4/MhspwbZq7GVwGaWmsWhTVImJXaULcD6bICa36ZewYEOERU EQDT6dQSeUUxw7vy+hZdFTmHekN2fEl4zLyO3zYYg1XE2lgkJQ2xHvFtAfSMHGLRd9kj gjD6VPgCgjVeQ9r8POkQs/eSUxio979R6aborPpnUOZDTSyXcac7jhJfj20E5bXNm1+p UlyCXClzuC//2AzEqUdnffant+yf4AqiDHWr8Z38raG+PgY/GH6r5J/TCZjJAA4utIsl F0NIaFjmQ6k1mr0YDh6ensi2UBoUvV9pYfyVaqU+Xx544hX2EGlpzixtKTuR5DQddVvC CrpA== X-Gm-Message-State: AOAM532lnW8J3CFmVcAp0WKX9mSTkZrh5QIDvfWNhoxS+xqY5SP3nC0e 0SalV/PxSDMQJ4YIbFPzqUwK7SvFqLh/ZA== X-Google-Smtp-Source: ABdhPJwQ8/xdc2t8mo3jtZf/yuUjY4mtjMOmqxaQFFOh3MeWAup5lrlvCdnmG07y8dX6ETNRPWYeOg== X-Received: by 2002:a1c:f70f:: with SMTP id v15mr7213561wmh.38.1609329927244; Wed, 30 Dec 2020 04:05:27 -0800 (PST) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id r13sm65197771wrt.10.2020.12.30.04.05.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 30 Dec 2020 04:05:26 -0800 (PST) In-Reply-To: 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:197020 Archived-At: Version: 28.1 Hi Tobias, On 27.12.2020 08:55, Tobias Rittweiler wrote: > Thank you. I tested the patch and it works fine. > > Some comments on the patch itself: > > 1. 'xref--project-root' returns a project root if 'project-root' is fboundp. >     Otherwise it returns a *list* of roots. > > 2. And in the second case, 'xref-backend-references' conses that list >     of roots to the list of external roots. I.e. it constructs an > improper list >     which it then passes to 'mapcan'. This is a bug, isn't it? > > 3. 'xref-expanded-seach-root` mispells "search" Thanks for the comments, I fixed them now. Also I've simplified the change closer to your original code. If anything, that made satisfying the tests easier. Pushed as 13b59c690a. That code also doesn't consider the "external roots", I figured it would be better to keep the group names unique. But we can revisit that later, if you or others do find those external long file names annoying (let me know). For now, closing.