unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Fumitaka Tokumitsu" <toku345@gmail.com>
To: "Stefan Monnier" <monnier@iro.umontreal.ca>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org, dgutov@yandex.ru
Subject: Re: UI inconveniences with M-.
Date: Sat, 02 May 2015 01:26:15 -0700 (PDT)	[thread overview]
Message-ID: <1430555175081.6ae666e3@Nodemailer> (raw)
In-Reply-To: <jwv8udbofyp.fsf-monnier+emacsbugs@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 7848 bytes --]

さほと



—
Sent from Mailbox

On Wed, Apr 29, 2015 at 11:41 AM, Stefan Monnier <monnier@iro.umontreal.ca>
wrote:

> [ Moving this to emacs-devel.  ]
>>> > Emacs 24 also had "C-u M-." to go to the next one.  This one doesn't;
>>> > moreover, if you try "C-u M-.", you get prompted for the symbol again,
>>> > and if you type the same one, you get nowhere.  The other matches are
>>> > only available via completion, see below.
>>> Maybe we should write an xref-old-ui-mode.
>> I didn't ask for the old UI.  (If I want it, I can still have it,
>> since the etags.el commands are still available.)  I'm okay with the
>> new UI.  This bug report is about the new UI, and its goal is to make
>> the new UI better.
> Then I don't understand what you mean by the text I quoted.  E.g.:
>    if you try "C-u M-.", you get prompted for the symbol again,
>    and if you type the same one, you get nowhere
> Well, duh!  What did you expect?  In the new UI, "C-u M-." jumps to
> *the* definition (the "C-u" is only used to let you type the name of
> thing you're looking for), so of course if you just jumped to it, asking
> to jump to it again will get you nowhere else.  I guess it would be OK
> to make M-. emit a message like "Hello?  We're already here!" in this
> corner case, if you want to make sure something happens.
>> old UI was consistent and complete: it always displayed the first/next
>> match and provided a command to go to the next/previous one.  By
>> contrast, the new UI is inconsistent: with some back-ends it shows the
>> list of matches and allows to navigate it, with others it shows only
>> the first match and does not give any way to get the next match.
> In the "M-. find-tag" example, the UI does let you see all matches.
> It's just that there's only one.  If you want, we could make this case
> popup an *xref* buffer with a single entry, but I think it makes more
> sense to just jump straight to that one entry instead.
>> But that's largely immaterial: this bug report is not about the
>> back-end, it's about the UI.
> I wouldn't be so sure.
>>> Arguably, the find-tag advice in org-ctags.el could be offered as well,
>>> if org-ctags.el happens to be loaded
>> ??? Why should the xref matches depend on what is and isn't loaded?
> Because that's how xref/elisp works.
>> That would make xref exactly equivalent to "M-x apropos", which means
>> this mode of operation would make xref entirely redundant.
> To you, maybe.  Personally, I find it's *much* quicker to use M-. than
> to use C-h f RET <go-to-the-link> RET, and it has the added benefit that
> M-, brings me right back if I need to.
>> To say nothing of the fact that this doesn't scale to any language
>> except ELisp.
> Not at all.  Many (most?) packages which offer a functionality along the
> lines of "M-. to jump to the definition" use an implementation technique
> which is fundamentally similar/equivalent (obviously, they don't query
> a running Emacs, but they query a running REPL).
>> We could offer this mode as an optional feature, but it certainly
>> shouldn't be the default.
> Many users here disagree.
>> (One of my worst annoyances is to type a C-h command and be presented
>> with "[No match]", because some package is not loaded or some function
>> is not available in the Emacs configuration I happen to be using.)
> Yes, that's a long standing problem, indeed.  I have a local hack which
> tries to add to loaddefs.el a concise description of where definitions
> might be found (basically, for each file, list the few prefixes used in
> that file), so that "C-h f" can load those packages when needed.
> It's "proof of concept" and it has occasionally rendered my Emacs
> session unusable (e.g. because it ended up deciding to try and load,
> say, w32-fns.el to see if it might contain the definition).  I think
> I've now solved most of those problems in the w32-* files, but the
> underlying risk is still there.
>> That's one way of looking at it.  Another is to say that etags gave
>> you more information and thus allowed to find more loose matches,
>> which is helpful when your memory is failing you.
> M-. jumps to the definition of the "thing under point".  There's no
> memory involved.
> If you're not sure what you're looking for, then you're expected to use
> the completion facilities in C-u M-.
>> But in the context of this bug report, that, too, is immaterial: if we
>> think the etags back-end gives too much information, by all means
>> let's filter it before presenting the matches.
> Yes, that's clearly very much needed.
>> Bonus points for making the filtering optional, since some people
>> might like that, and in some situations even you might need it.
> I disagree.  The filtering is needed by the design of the xref API.
> If you want to see the "unfiltered" data, then use M-x xref-find-apropos.
>> Then let's fix the results we display with the etags back-end to show
>> only the relevant ones.
> Yes, please.
>> Saying that the back-end returns a confusingly large amount of bogus
>> matches, and then switching to a UI that assumes much smarter
>> back-ends (which don't really exist) makes very little sense to me.
> The smarter backends already exist, in so far as there is already code out
> there which provides the needed functionality.  It just doesn't use the
> xref API yet, because it was written before xref.el.
>> The old code attempted to support both use cases, by showing the exact
>> match(es) first, followed by less likely ones.  We do similar things
>> in other commands.  The advantages of such a method are that (1) you
>> don't need to second-guess the user, (2) you provide only one command
>> for the user to remember, and (3) if the user only _thinks_ she knows
>> the name, but really doesn't, she can find the information without
>> having to invoke another command.
>>> I think that's an important feature of the new code in this respect.
>> But it is incomplete without a means to get to the other possible
>> matches in this case.
>> To summarize my points in this sub-thread:
>>   . the UI should depend much less on the back-end, ideally not at all
> You keep repeating this, but that is absolutely meaningless to me (kind
> of like "it doesn't work" in bug reports):
> - This consistency was trivially obtained with the old etags.el code
>   since it had one 1 backend.
> - What the fuck should the new UI do if one backend returns 1 match and
>   another returns a hundred (as in your "find-tag" example)?
>>   . there should be a way to go to the next/previous match if the
>>     *xref* buffer is not displayed (or not created in the first
>>     place); if this happens because there's only one match, we should
>>     say so explicitly
> The only case where the *xref* is not displayed is when there's only
> 1 match returned by the backend.  So "go to the next/previous match" is
> again meaningless.
>>   . when there are more than one possible match, the UI should behave
>>     similarly, i.e. display the *xref* buffer; when there's only one
>>     match, it should _never_ display *xref*,
> That's exactly what the code does.
>>     and should display an indication of the fact that there's only one
>>     match
> The current code "displays" this indication by jumping to the sole match
> instead of jumping to the *xref* buffer.  I think it's clear enough.
>>   . if the criteria for filtering of the matches are very different
>>     between the possible back-ends, there should be some agreed-upon
>>     uniform default that returns roughly the same number of matches
>>     with all back-ends, and the rest should be controlled by user
>>     options
> I don't see what that could concretely look like.
>         Stefan

[-- Attachment #2: Type: text/html, Size: 8951 bytes --]

  parent reply	other threads:[~2015-05-02  8:26 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <83zja6b3tc.fsf@gnu.org>
     [not found] ` <54A24079.4020902@yandex.ru>
     [not found]   ` <m261ctczy1.fsf@gmail.com>
     [not found]     ` <54A2FF47.6010207@yandex.ru>
     [not found]       ` <m2h9wcwxrp.fsf@gmail.com>
     [not found]         ` <54A86135.7080004@yandex.ru>
     [not found]           ` <54A90002.7080009@gmx.at>
     [not found]             ` <54A9C3FB.7000602@yandex.ru>
     [not found]               ` <54AA3881.3080304@gmx.at>
     [not found]                 ` <54ABBB47.7010603@yandex.ru>
     [not found]                   ` <837fszx7iy.fsf@gnu.org>
     [not found]                     ` <jwv618iqjvj.fsf-monnier+emacsbugs@gnu.org>
     [not found]                       ` <83r3r5wqwv.fsf@gnu.org>
     [not found]                         ` <jwvvbgh5vve.fsf-monnier+emacsbugs@gnu.org>
     [not found]                           ` <83k2wxwexb.fsf@gnu.org>
     [not found]                             ` <jwvoam9459c.fsf-monnier+emacsbugs@gnu.org>
     [not found]                               ` <83fv7kwbow.fsf@gnu.org>
2015-04-29  2:41                                 ` UI inconveniences with M- Stefan Monnier
2015-04-29  6:10                                   ` Helmut Eller
2015-04-29 13:23                                     ` conflicting uses of next-error-function (was: UI inconveniences with M-.) Stefan Monnier
2015-04-29 16:58                                       ` conflicting uses of next-error-function Helmut Eller
2015-04-29 17:40                                         ` Dmitry Gutov
2015-04-29 18:15                                           ` Helmut Eller
2015-04-29 23:14                                             ` Dmitry Gutov
2015-04-30  6:19                                               ` Helmut Eller
2015-04-30  8:04                                                 ` Dmitry Gutov
2015-04-30 17:46                                                   ` Helmut Eller
2015-05-02 23:20                                                     ` Dmitry Gutov
2015-05-03  6:54                                                       ` Helmut Eller
2015-05-03 11:45                                                         ` Dmitry Gutov
2015-05-03 13:25                                                           ` Helmut Eller
2015-05-03 14:12                                                             ` Dmitry Gutov
2015-05-04 22:21                                                               ` Ted Zlatanov
2015-05-05  2:28                                                                 ` Dmitry Gutov
2015-05-05  9:47                                                                   ` Ted Zlatanov
2015-05-05 14:05                                                                     ` Dmitry Gutov
2015-05-05 14:26                                                                       ` Ted Zlatanov
2015-04-29 23:05                                       ` Vitalie Spinu
2015-04-29 23:11                                         ` Dmitry Gutov
2015-04-29 23:52                                           ` Vitalie Spinu
2015-04-29 23:15                                       ` Dmitry Gutov
2015-04-30  6:35                                         ` Stefan Monnier
2015-04-29 15:26                                     ` UI inconveniences with M- Vitalie Spinu
2015-04-30  0:44                                       ` Dmitry Gutov
2015-04-30  0:55                                         ` Vitalie Spinu
2015-04-29 17:08                                     ` Dmitry Gutov
2015-04-29 15:44                                   ` Eli Zaretskii
2015-04-29 15:57                                     ` Dmitry Gutov
2015-04-29 16:17                                       ` Eli Zaretskii
2015-04-29 16:25                                         ` Dmitry Gutov
2015-04-29 16:53                                           ` Eli Zaretskii
2015-04-29 17:06                                             ` Dmitry Gutov
2015-04-29 17:15                                               ` Eli Zaretskii
2015-04-29 17:26                                                 ` Dmitry Gutov
2015-04-29 17:59                                                   ` Eli Zaretskii
2015-04-29 18:10                                                     ` Dmitry Gutov
2015-04-29 21:54                                     ` Stefan Monnier
2015-04-30 13:42                                       ` Eli Zaretskii
2015-05-01 14:21                                         ` Stefan Monnier
2015-05-01 18:32                                           ` Eli Zaretskii
2015-05-01 21:04                                             ` Stefan Monnier
2015-05-01 21:13                                               ` Dmitry Gutov
2015-05-02  7:00                                                 ` Stefan Monnier
2015-05-02  7:18                                               ` Eli Zaretskii
2015-05-02  8:35                                           ` Fumitaka Tokumitsu
2015-05-01 21:11                                         ` Dmitry Gutov
2015-05-02  8:12                                           ` Eli Zaretskii
2015-05-02  8:46                                             ` Fumitaka Tokumitsu
2015-05-02 12:41                                             ` Dmitry Gutov
2015-05-02 12:57                                               ` Eli Zaretskii
2015-05-02 13:31                                                 ` Dmitry Gutov
2015-05-02 13:44                                                   ` Eli Zaretskii
2015-05-02 17:44                                                     ` Dmitry Gutov
2015-05-02  8:26                                   ` Fumitaka Tokumitsu [this message]
     [not found]                             ` <553EB9D7.7010002@yandex.ru>
     [not found]                               ` <jwvd22p2mfh.fsf-monnier+emacsbugs@gnu.org>
     [not found]                                 ` <553EC576.70903@yandex.ru>
     [not found]                                   ` <jwviochrqkt.fsf-monnier+emacsbugs@gnu.org>
     [not found]                                     ` <553EE468.4070203@yandex.ru>
     [not found]                                       ` <jwvlhhcqt3q.fsf-monnier+emacsbugs@gnu.org>
     [not found]                                         ` <553FF5DA.4090408@yandex.ru>
2015-04-29  3:13                                           ` Stefan Monnier
2015-04-29  3:25                                             ` Dmitry Gutov
2015-04-29  4:15                                               ` Stefan Monnier
     [not found]                           ` <553EBBBF.6070509@yandex.ru>
     [not found]                             ` <838udcwbdc.fsf@gnu.org>
     [not found]                               ` <553FFC99.5080701@yandex.ru>
     [not found]                                 ` <834mnzuedd.fsf@gnu.org>
     [not found]                                   ` <554161A8.30202@yandex.ru>
     [not found]                                     ` <83618du3q3.fsf@gnu.org>
     [not found]                                       ` <5542E486.2010107@yandex.ru>
     [not found]                                         ` <83k2wsssm8.fsf@gnu.org>
     [not found]                                           ` <5543632C.6000306@yandex.ru>
     [not found]                                             ` <834mnwsbfb.fsf@gnu.org>
     [not found]                                               ` <554392E2.7080109@yandex.ru>
     [not found]                                                 ` <83oam4qh2u.fsf@gnu.org>
     [not found]                                                   ` <5543C97C.6050000@yandex.ru>
     [not found]                                                     ` <83h9rwqf10.fsf@gnu.org>
     [not found]                                                       ` <5543E3CF.5010402@yandex.ru>
2015-05-02  6:59                                                         ` Stefan Monnier
2015-05-02  7:59                                                           ` Helmut Eller
2015-05-02  8:39                                                             ` Eli Zaretskii
2015-05-02  9:09                                                               ` Helmut Eller
2015-05-02  9:24                                                                 ` Eli Zaretskii
2015-05-02  9:50                                                                   ` Helmut Eller
2015-05-02 18:29                                                             ` Dmitry Gutov
2015-05-02 13:13                                                           ` xref "find references" and grouping Dmitry Gutov
2015-05-02 14:14                                                             ` Helmut Eller
2015-05-02 19:01                                                               ` Dmitry Gutov
2015-05-03  7:47                                                                 ` Helmut Eller
2015-05-04  1:35                                                                   ` Stefan Monnier
2015-05-04  2:09                                                                   ` Dmitry Gutov
2015-05-04 13:10                                                                     ` Vitalie Spinu
2015-05-04 14:21                                                                       ` Vitalie Spinu
2015-05-04 21:29                                                                       ` Dmitry Gutov
2015-05-05  0:02                                                                         ` Vitalie Spinu
2015-05-05  0:18                                                                           ` Dmitry Gutov
2015-05-05  1:45                                                                             ` Vitalie Spinu
2015-05-02 19:10                                                           ` UI inconveniences with M- Dmitry Gutov
2015-05-04 13:41                                                           ` Vitalie Spinu
2015-05-04 21:34                                                             ` Dmitry Gutov
2015-05-05  0:13                                                               ` Vitalie Spinu
2015-05-05  0:14                                                                 ` Dmitry Gutov
2015-05-05  1:36                                                                   ` Vitalie Spinu
2015-05-05 15:06                                                                     ` Dmitry Gutov
     [not found]                       ` <83pp6pwqnw.fsf@gnu.org>
     [not found]                         ` <jwv1tj57b9o.fsf-monnier+emacsbugs@gnu.org>
     [not found]                           ` <553EB74A.4030208@yandex.ru>
     [not found]                             ` <jwvoam92niy.fsf-monnier+emacsbugs@gnu.org>
     [not found]                               ` <83618gwbb1.fsf@gnu.org>
2015-04-29  3:12                                 ` Etags.el (was: UI inconveniences with M-.) Stefan Monnier
2015-04-29 15:52                                   ` Eli Zaretskii
2015-04-29 22:14                                     ` Etags.el Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1430555175081.6ae666e3@Nodemailer \
    --to=toku345@gmail.com \
    --cc=dgutov@yandex.ru \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).