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: UI inconveniences with M-. Date: Mon, 04 May 2015 15:41:28 +0200 Message-ID: <87r3qwpiif.fsf@gmail.com> References: <83zja6b3tc.fsf@gnu.org> <837fszx7iy.fsf@gnu.org> <83r3r5wqwv.fsf@gnu.org> <553EBBBF.6070509@yandex.ru> <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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1430746914 28312 80.91.229.3 (4 May 2015 13:41:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 4 May 2015 13:41:54 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org, Dmitry Gutov To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 04 15:41:48 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 1YpGd2-0001Ep-3f for ged-emacs-devel@m.gmane.org; Mon, 04 May 2015 15:41:48 +0200 Original-Received: from localhost ([::1]:34305 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpGd1-0003ia-DT for ged-emacs-devel@m.gmane.org; Mon, 04 May 2015 09:41:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpGcp-0003hG-5n for emacs-devel@gnu.org; Mon, 04 May 2015 09:41:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YpGco-000655-5s for emacs-devel@gnu.org; Mon, 04 May 2015 09:41:35 -0400 Original-Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]:35630) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpGck-00064a-AL; Mon, 04 May 2015 09:41:30 -0400 Original-Received: by widdi4 with SMTP id di4so121949504wid.0; Mon, 04 May 2015 06:41:29 -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=YHH+CSg7eIkIz+23RQcca6C/lgGQdFKtdJI8Lvjp1xo=; b=AcgfQqmNr5XP5kbYfv6l8pAWpSuN0sucYaJ3t/HUyg6gbAMhddKzTAeKz5V3+x7dip QqEG20h4BPKjTt7RTODYDLAL/+2Lum0C5MZD0iPN7Gosgd49DplAl5Ul79vFHJtBFnOO OT9Kox1ErzIVRCkEd+xOO3yoajyf7nruqE4Igww9COYuNFp0C0bu2QojrgeWHz575cqy ylHmzNa9Fikqm/BMr9ua4rUa999Y7zvqpRtebxS+SVJNo7LlxBXv9ylYlFxskXa+eGF5 z6sB9YrSoewSL98401hH4rDLxIAuke8VxwDNdyxFvrkghYIFMw8d8u1/tz7IWf1XFXe/ wHTg== X-Received: by 10.180.206.229 with SMTP id lr5mr19888915wic.86.1430746889561; Mon, 04 May 2015 06:41:29 -0700 (PDT) Original-Received: from localhost (dhcp-077-251-128-242.chello.nl. [77.251.128.242]) by mx.google.com with ESMTPSA id di9sm11277073wib.16.2015.05.04.06.41.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 May 2015 06:41:28 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Sat, 02 May 2015 02:59:28 -0400") 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::22a 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:186183 Archived-At: >>> Stefan Monnier on Sat, 02 May 2015 02:59:28 -0400 wrote: > - make xref-find-function return not a list of locations, but a list of > lists of locations (i.e. every location inside a sub-list is > considered to have the same "level/quality/likelihood", but the lists > are sorted by their "level/quality/likelihood"). That would allow for one hard-codded sorting. I think it's much better to return a plist of metadata for each candidates. Then you can order on multiple criteria. > - let the backend provide its own sorting function to override the > current "group by file" sorting. I think that's the task for the user to decide. The backend can compute it's own :priority meta score and pass it back. If user's custom var says sort on :priority then sort on priority. Some backends might return more meta than others, so user's option should be a list (:priority :type :file). The sorting algorithm should got through the list and sort on first component which is defined. :file must be defined for all backends. > I think it would make sense to make it possible for the user to > dynamically choose among the potentially many more backends (e.g. we > could add an xref/grep backend, and there will hopefulyl be more using > things like id-utils, gtags, ...) and maybe also to use several backends > at the same time (merging the results). Ho about the following UI. Instead of one set of backends you have multiple levels of increasing sets of backends. At each moment of time there is only one active "set" which you can change with `xref-rotate-level`. The user then can customize levels of backends: xref-backend-level-1 . (xref-default-mode-backend) xref-backend-level-2 . (xref-etags elisp-xref) xref-backend-level-3 . .... A set corresponding to level N would automatically include all backends from the lower levels. In the above example, if you set the level to 2 xref will merge default-backend, etags and elisp-xref. Thus the UI is only 2 commands: xref-add-backend-in-level (ask for level and on prefix remove backend) xref-rotate-level (with numeric prefix, set level) Users can then customize each level per mode or globally and thus have consistent levels that they can rely upon independently of the context. Vitalie