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.devel Subject: Re: Xref completion Date: Thu, 3 Dec 2020 02:25:08 +0200 Message-ID: <9bbe9827-8e96-e45c-2e0f-23a4fb5aea33@yandex.ru> References: <873617ets1.fsf@ambrevar.xyz> <878sazzsw5.fsf@mail.linkov.net> <7593e751-cff0-7c1a-7d4c-f927a16c07c9@yandex.ru> <3b255b14-6494-99dc-1e78-9607e0d1fcd9@yandex.ru> <87tut351ea.fsf@mail.linkov.net> 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="26164"; 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: emacs-devel@gnu.org To: Juri Linkov , William Xu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 03 01:26:25 2020 Return-path: Envelope-to: ged-emacs-devel@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 1kkcS0-0006gk-Gk for ged-emacs-devel@m.gmane-mx.org; Thu, 03 Dec 2020 01:26:24 +0100 Original-Received: from localhost ([::1]:44022 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkcRz-0004oi-FB for ged-emacs-devel@m.gmane-mx.org; Wed, 02 Dec 2020 19:26:23 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkcQt-0003tV-3k for emacs-devel@gnu.org; Wed, 02 Dec 2020 19:25:15 -0500 Original-Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]:39735) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kkcQr-0003sW-00 for emacs-devel@gnu.org; Wed, 02 Dec 2020 19:25:14 -0500 Original-Received: by mail-ej1-x635.google.com with SMTP id n26so804477eju.6 for ; Wed, 02 Dec 2020 16:25:12 -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=QICAAFPQHr8hdweBlzCcoZdEOeA28GvMa8rdiMf4I+w=; b=nUJkhZLdotT7BPHHdflfVMuP1WLJfxXCfEgw/hjbZ28Jmvud0fFOSYrK4Quf1FcSxp FuRKuVTMNkh4jUX7nemvNRVrx2Fa5ZY4NnB8+CLwHVjRsDOsetSCu+k/9EnmEthNfTBR aW/exbt+kQc65pg5Vmvef5tsW29BQdgq8WUKDKDtKrayetL3mi7sjym26cOtdTaaIFgj RnkiTjh2oszhh6W6yGGublgDOcWQvHrTq38y6J1ixyJj1QyDUpwln4uiQuqp8krDyl7/ SFx05jkdoUyLQYGDA8b60VA5VPb1jc10g6zitZ2jBtv7pPT/z9U6Kh7NNgMJRojxB/tH 2vOQ== 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=QICAAFPQHr8hdweBlzCcoZdEOeA28GvMa8rdiMf4I+w=; b=rhxYBFNyaD1a4/wXWKwjIjPTq01buDjWQIM2aFFycWYEkPMhmYFg0A2E/QLj4cXYaI zb3GYOutitFmaOIhiOQo0mHRi09GYQqexx5YIvlsGiU/UvRl3s5UDECcT+4YmmAkySaF jPupyBi/Qt1bvbx4AKttik3csrw1/Gl2SNrvGCqAxbi1W8yv2qYDJUE94JaalTpUTMF2 F7SIsx+3yd4vkILKJ2Xllg78hTH6mqS3H+hru4JgQUWzw/CfI/AF4K6uQa5L2F40VUnQ nrPtMNH0VKJCVK9z3Zx3Iw99hwjFdadgb8ozZEHGgMkE2xiwFgwL/V+7BLQ+VRE2TgDq bhgQ== X-Gm-Message-State: AOAM531QHBOpNYM/pYVMhoBcG+67O2fTrC+XhJohrGT5+FQ8yD29mG/Y dSOxBXmFWAs8LlMCnDE13xKFks7Fpf2VWg== X-Google-Smtp-Source: ABdhPJwl/Mq9gl7zTZ6gX3+hv6RnzTrH8IKvhgCuyBmfUqFdPS316L5ieZ9wFq0p7OfYOOQe880n4A== X-Received: by 2002:a17:906:6b88:: with SMTP id l8mr315810ejr.482.1606955110983; Wed, 02 Dec 2020 16:25:10 -0800 (PST) Original-Received: from [192.168.0.4] ([66.205.71.3]) by smtp.googlemail.com with ESMTPSA id y15sm216306eds.56.2020.12.02.16.25.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Dec 2020 16:25:09 -0800 (PST) In-Reply-To: <87tut351ea.fsf@mail.linkov.net> Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=raaahh@gmail.com; helo=mail-ej1-x635.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:260195 Archived-At: On 02.12.2020 23:44, Juri Linkov wrote: >> One more point, I'm not sure if the order of the candidates are >> important or not, but we can keep it the same order as in xref buffer. > > Yes, better to keep the same order. > > One additional question: is it possible to use only relative file names, > relative to the project root dir? Absolute file names are too long. Not always possible to do it against the project root (xref-find-definitions does not depend on project.el), but you can still find the longest parent directory and cut it off, similarly to how it's done in project--read-file-cpd-relative. > BTW, like you created xref--show-defs-minibuffer > as a possible option for xref-show-definitions-function, > wouldn't it be also nice to do the same and create > xref--show-xref-minibuffer as a possible option for > xref-show-xrefs-function? Don't you usually want to iterate across multiple results, when the command is project-find-regexp or xref-find-references? Then the same logic will not work. I mean, sometimes you probably want to find just one match, but changing xref-show-xrefs-function will affect all invocations. Or maybe I should ask: how will xref--show-xref-minibuffer be different from xref--show-defs-minibuffer?