From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vitalie Spinu Newsgroups: gmane.emacs.devel Subject: Re: xref "find references" and grouping Date: Mon, 04 May 2015 15:10:35 +0200 Message-ID: <87vbg8pjxw.fsf@gmail.com> References: <83zja6b3tc.fsf@gnu.org> <838udcwbdc.fsf@gnu.org> <553FFC99.5080701@yandex.ru> <834mnzuedd.fsf@gnu.org> <554161A8.30202@yandex.ru> <83618du3q3.fsf@gnu.org> <5542E486.2010107@yandex.ru> <83k2wsssm8.fsf@gnu.org> <5543632C.6000306@yandex.ru> <834mnwsbfb.fsf@gnu.org> <554392E2.7080109@yandex.ru> <83oam4qh2u.fsf@gnu.org> <5543C97C.6050000@yandex.ru> <83h9rwqf10.fsf@gnu.org> <5543E3CF.5010402@yandex.ru> <5544CD91.2050301@yandex.ru> <55451F0B.7010003@yandex.ru> <5546D4CD.20403@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1430745065 28641 80.91.229.3 (4 May 2015 13:11:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 4 May 2015 13:11:05 +0000 (UTC) Cc: Helmut Eller , emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 04 15:11:04 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 1YpG9H-0007uC-Qa for ged-emacs-devel@m.gmane.org; Mon, 04 May 2015 15:11:03 +0200 Original-Received: from localhost ([::1]:34190 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpG9H-0005QL-4y for ged-emacs-devel@m.gmane.org; Mon, 04 May 2015 09:11:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53225) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpG8x-0005Oh-5z for emacs-devel@gnu.org; Mon, 04 May 2015 09:10:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YpG8t-0004bY-Kh for emacs-devel@gnu.org; Mon, 04 May 2015 09:10:43 -0400 Original-Received: from mail-wi0-x232.google.com ([2a00:1450:400c:c05::232]:34255) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpG8s-0004bH-T2 for emacs-devel@gnu.org; Mon, 04 May 2015 09:10:39 -0400 Original-Received: by wicmx19 with SMTP id mx19so77082649wic.1 for ; Mon, 04 May 2015 06:10:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=LiwJWWhOP/R8CFL8W8qN67WL4IaIJNSw8znPzawm83E=; b=jXuLyRX3NW0jmZAJtVmi2kvy7URP2EngwsFQnUmfu89z2z8xx1zEfjWG2vELaOZ8pU mfTRg/UAC0YYqfTuFNgVEK2QNXuut1YM9+vQSXO+CEQZr9wi7VwpZ5Xs5ccWaraEQkqE 6yqxD1P6qwLVJ2ndoI5HodGTnf5hQYF3A2bu7+0f8bi5LZGzRQSEq8mdvJuYn86Gz2ul UDSMt8Sy3xsT2lXDTGlONBBbakMmf+eY2Y4WEUBpVD+XnE/Trw5CVMymHh+EzrNTRgS5 dE1DxilkQzzv1oX0JwsZnD431A1d+1zw0wu/9C1IJicrRowy4R686V+2O+4ZXHKVT3yt KhSg== X-Received: by 10.180.105.74 with SMTP id gk10mr19466118wib.29.1430745037619; Mon, 04 May 2015 06:10:37 -0700 (PDT) Original-Received: from localhost (dhcp-077-251-128-242.chello.nl. [77.251.128.242]) by mx.google.com with ESMTPSA id bg4sm4461052wjc.10.2015.05.04.06.10.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 May 2015 06:10:36 -0700 (PDT) In-Reply-To: <5546D4CD.20403@yandex.ru> (Dmitry Gutov's message of "Mon, 4 May 2015 05:09:17 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::232 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:186181 Archived-At: >>> Dmitry Gutov on Mon, 4 May 2015 05:09:17 +0300 wrote: > A set of widgets (like generic group, file group, method group, and a few kinds > of locations) will allow any language mode to return a structured set of > matches, which can even be rendered in different ways. Ho about a simple tabular interface. Each back-end will return a list of matches with a backend specific plist of metadata. For example: (foo . (:file "path/to/foo-file" :line 23 :priority 1 :type "method" :class "baz")) Then arrange the xref in a simple flat table: File Priority Type Class Target path/to/foo-file:23 1 method bax foo ... ... ... ... ... Then add a sorting command to sort on File, Priority Type etc. and introduced a custom var for the default sorting. There is a mode in emacs for tabular display, I forgot its name but I think it already takes care of the sorting and other useful stuff. Note that sorting with trees is not so straightforward. Depending on sorting criteria you will get a very different trees in terms of inner structure. Trees also tend to waste a lot of space and are more demanding cognitively because you need to figure out where one tree starts and where it ends. As the "height" of each tree is different that could be a rather hard task unless you use a clear delimiter between trees. But that means using additional vertical space for delimiters. One huge advantage of flat displays is that you can narrow candidates on whatever component. So you can simply use selective display like occur, helm-occur or ivy to narrow your buffer. You cannot do that with trees. Vitalie