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: Consistency for xref-show-{xrefs,definitions}-function Date: Fri, 15 Jan 2021 19:20:34 +0200 Message-ID: References: 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="31604"; 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 To: Gabriel do Nascimento Ribeiro , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jan 15 18:22:13 2021 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 1l0Snc-0007pK-Nc for ged-emacs-devel@m.gmane-mx.org; Fri, 15 Jan 2021 18:22:12 +0100 Original-Received: from localhost ([::1]:58366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0Snb-0003tW-O9 for ged-emacs-devel@m.gmane-mx.org; Fri, 15 Jan 2021 12:22:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39930) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0SmD-0002hM-24 for emacs-devel@gnu.org; Fri, 15 Jan 2021 12:20:45 -0500 Original-Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:50540) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l0Sm8-00016C-Ux for emacs-devel@gnu.org; Fri, 15 Jan 2021 12:20:44 -0500 Original-Received: by mail-wm1-x32d.google.com with SMTP id 190so8084454wmz.0 for ; Fri, 15 Jan 2021 09:20:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=GW9+SVh3X/fHvLrWB4ZwqNcWBqQ8vHl6/qn6d9Kgq6M=; b=IiOv00R+yrOnXOIKpK6T3I1IgHemZz/JoL0vn/M6rbPyy95mz2oHXlC4l5yxSOqcBV FwW0TqDLZtghEg8011ORsUrjWV26N/5eJ+By7H4blKU+I9FsT70TyrNqNmD724Yq93Tz hT8Bsh7+nTxD0D2c4AIJ5465XXwpGD3pDyu5OPv9BCoIJbnCnZdMkoMb8Pwc5RQskX0c lDKbopTv6w/X//fhVEHXpUHserb5T5ffGrOK1D2cpLcGS+OU0g05IGJj3LMYIm8mu9R5 2U67rPA7B3XDF/tSgzPukrH81xTCEXJUXfrCgZ6bJ/z4SJO4vc2pBBF+GsP1dE1o+Feo JzVA== 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:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=GW9+SVh3X/fHvLrWB4ZwqNcWBqQ8vHl6/qn6d9Kgq6M=; b=fYNTIQGDVR/kMPQqHaTp1SnaOr15eEtNAoccREEllOcVWTIlltMz7eQIUJ0fr6DrOU jz9tStQqRzp4WR1/c+JyM1gDu7cuwsj3aBqrhNxVNK+GF9tKyqjzhcb5uZFfIswYT2jU SU7o0AU+QOCOn3kWJOCZVwLLp47i/V7Y/UCGcooWulDNAaUudH/7PSDXCpEwwlLzyXwg mxOt2EOdrAgqci8C8/Q/ffnemiDOXsVrEhy1U7Qjl2lbjop5Zj4qLK56wO4DkiLPxHng u24eIwmyD285T9M2PW56S8ls1ESr86MQiq+mHaQ/slYNabR1nUKN4gWGAW4RfRLNe3il fwvg== X-Gm-Message-State: AOAM530ja53QAkNKh1paWL62wHjx72B81CbMv1TzTKWRqglIcuVRRGVY 5an9NxwSj5A5j17+r+ewzLF4GdJuYPQ= X-Google-Smtp-Source: ABdhPJxXJYUAfstfR2/K5ARvUaQFsM+1o85wqleWiFWuCndUw6KhWTot4JlMeBYTIGe45EjNxwua1A== X-Received: by 2002:a7b:c24b:: with SMTP id b11mr9803253wmj.168.1610731239034; Fri, 15 Jan 2021 09:20:39 -0800 (PST) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id i59sm12061490wri.3.2021.01.15.09.20.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 Jan 2021 09:20:38 -0800 (PST) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=raaahh@gmail.com; helo=mail-wm1-x32d.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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, 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:263079 Archived-At: Hi! On 14.01.2021 22:27, Gabriel do Nascimento Ribeiro wrote: > I noticed that the options 'xref-show-xrefs-function' and > 'xref-show-definitions-function' are not symmetrical. > > The defcustom for 'xref-show-xrefs-function' does not have type choices > as 'xref-show-definitions-function' has. Furthermore, it's quite strange > to configure it as follow: > > (setq xref-show-xrefs-function > 'xref-show-definitions-completing-read) > > I suggest to create similar functions for 'xref-show-xrefs-function', > which at this moment can be just aliases but can be independent > functions in the future, if necessary: > - xref-show-xrefs-buffer > - xref-show-xrefs-buffer-at-bottom > - xref-show-xrefs-completing-read > > Also, the docstrings of both options could be improved a little bit to > give more information about the default choices. > > I can submit a patch if these suggestions are accepted. Why do you want this? xref-find-definitions differs from the rest of Xref-using commands in that it usually only find one location, and when there are several, the user wants to quickly choose one of the alternatives, the faster the better. The different options for xref-show-definitions-function provide different solutions for that problem. In all other cases returning multiple results is the common case, and you usually want to see all of them, not just one. For that, the completing-read UI, for example, is not very suitable.