From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: xref display and multiple locations, was: Re: Unified project interface Date: Thu, 30 Jul 2015 02:11:25 +0300 Message-ID: <55B95D9D.6070704@yandex.ru> References: <557039DB.4060607@yandex.ru> <85d21bbkqf.fsf@stephe-leake.org> <5570E86B.8070200@yandex.ru> <85iob2a2mm.fsf@stephe-leake.org> <55B2CDA4.8020207@yandex.ru> <868ua5caz6.fsf@stephe-leake.org> <55B441DD.9060806@yandex.ru> <86zj2jb1tx.fsf@stephe-leake.org> <55B517AC.5020401@yandex.ru> <86oaiybvbf.fsf@stephe-leake.org> <55B62B53.5060003@yandex.ru> <861tftaxgx.fsf@stephe-leake.org> <55B78F49.6010101@yandex.ru> <868ua09s1y.fsf@stephe-leake.org> <55B7CD86.20306@yandex.ru> <86oaiv8zqn.fsf@stephe-leake.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1438211510 30927 80.91.229.3 (29 Jul 2015 23:11:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 29 Jul 2015 23:11:50 +0000 (UTC) To: Stephen Leake , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 30 01:11:49 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZKaVm-0006h3-NL for ged-emacs-devel@m.gmane.org; Thu, 30 Jul 2015 01:11:46 +0200 Original-Received: from localhost ([::1]:37301 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKaVl-0005Oj-TO for ged-emacs-devel@m.gmane.org; Wed, 29 Jul 2015 19:11:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39223) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKaVa-0005Oc-Gq for emacs-devel@gnu.org; Wed, 29 Jul 2015 19:11:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZKaVV-00081L-A7 for emacs-devel@gnu.org; Wed, 29 Jul 2015 19:11:34 -0400 Original-Received: from mail-wi0-x22b.google.com ([2a00:1450:400c:c05::22b]:37267) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKaVV-00081A-3T for emacs-devel@gnu.org; Wed, 29 Jul 2015 19:11:29 -0400 Original-Received: by wibud3 with SMTP id ud3so45682999wib.0 for ; Wed, 29 Jul 2015 16:11:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=SjqPIVw0s3C2lmlWAvF54h+NE0qfmSp93FpA1llwi6A=; b=Lr7c0AliEaorLvQY67w3xyMm4bOhOlC3yz1cepUq+ogCIF/+f8jjTdWcMi3rA/gFtc DUkTnYE+yNthrHDJKyoJpKA6HXUBRBcKUgmqZ11RWRGAmV0GpttgHUIDbp1IFpjBkuur MD7aONt1KFwdKAYO31HXE9/BxGb3yAHVkpxtv55GmaPHYimrR5Z6UGYsvb/0y2zTc8lI xhO6yODk2/W3YijQBeMlr6/8/WvgVmUT+gNvYDnKAKiR7d0dOgYbKgfSrCf8iywamlqe iuVz0JXDau1MD+4uUgPoKw6lnloBnGRYeLztFSzFSTsCGlUZ3tyEFbx2aTn1a04Obo3a 5L3A== X-Received: by 10.180.109.136 with SMTP id hs8mr193433wib.73.1438211488397; Wed, 29 Jul 2015 16:11:28 -0700 (PDT) Original-Received: from [10.9.0.103] (nat.webazilla.com. [78.140.128.228]) by smtp.googlemail.com with ESMTPSA id r6sm26686419wiy.13.2015.07.29.16.11.27 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Jul 2015 16:11:27 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0 In-Reply-To: <86oaiv8zqn.fsf@stephe-leake.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22b X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:188180 Archived-At: On 07/29/2015 05:27 AM, Stephen Leake wrote: > Currently, 'grep-find' and 'compilation' share the same location API. > Which is why I suggested that xref also share it. But I do like the > current xref location display, so maybe there is a case for them to > remain distinct. > > They serve different purposes; the xref display makes it easy to choose > one location from a small list; the compilation display makes it easier > to step through all of them in sequence, and it works even for very long > lists. I've come to believe that it's a mistake. The only xref command where we're likely to only be only in one location is xref-find-definitions, and in ideal implementations, it's likely not to show the xref buffer at all, jumping straight to the sole result. So in the average case, pressing RET, or clicking on an xref element, should display the location, but keep the xref buffer displayed as well. We just need a way to use the current behavior in xref-find-definitions (or implement a yet-another selection interface for it). > There should at least there should be this choice of display; the > location data structure could probably be shared (the compilation > location structure contains more info). The current customization point is xref-show-xrefs-function. There are no different implementations yet. One nice feature of M-x grep, by the way, is that it shows the matches immediately as it finds them (whereas the current xref commands are forced to wait until the output ends, and collect the whole list). One way to reach parity there would be to teach xref to accept generators (as implemented in generator.el), as well as regular lists. > (grep-find could eventually be made obsolete in favor of > project-find-regexp). Here's hoping.