all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Vitalie Spinu <spinuvit@gmail.com>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: emacs-devel@gnu.org
Subject: Re: Bad moves with xref-find-definitions
Date: Sun, 26 Apr 2015 13:31:36 +0200	[thread overview]
Message-ID: <87zj5vm8h3.fsf@gmail.com> (raw)
In-Reply-To: <jwvwq0zbmzn.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sat, 25 Apr 2015 23:34:36 -0400")

 >>> Stefan Monnier on Sat, 25 Apr 2015 23:34:36 -0400 wrote:

 >> That's a bit besides the point. I want my interface to behave exactly
 >> the same independently of the context at point.

 > You're talking here about the fact that M-. will prompt if there's no
 > "thing at point"?  

Yes.

 > We could make it signal an error, indeed.

I would like that. At least it would force people using C-u. Now I
always navigate to empty space, even though I ware that it's a
completely stupid habit.

>> And, most importantly, I don't want to foster bad habits because my
 >> brain always chooses the easy path - navigate to a symbol instead of
 >> C-u.

 > Thing is: the two are different.  In some languages, figuring out "the
 > thing at point" may itself not be obvious and even finding
 > a human-palatable textual representation of "the thing at point" may
 > turn out to be extra work.

 > So M-. really means "pass the current buffer position to the backend and
 > let it figure out what are the possible corresponding definitions".
 > Whereas C-u M-. asks the user for a textual representation of some
 > definition, and then tries to find matching definitions.

 > Of course, we could make the "empty minibuffer" mean "use the current
 > buffer position", but it seems cleaner to short-circuit the minibuffer
 > so we don't have to use a special string for it.

Backend has to figure out the "thing" anyways. From there building
"textual representation" and passing back to xref is a triviality. Also,
you have to provide completions and textual representation of on C-u
anyways.

What do you currently do if there are multiple matching definitions of
the "thing-at-point"? Prompt?

 >> Having C/C++ api interface to higher order languages is a commonality
 >> rather than an exception nowadays.

 > I do not understand what you're trying to say here (more specifically,
 > I can't see how this relates to the discussion).

All I was trying to say is that tags are commonly useful alongside
dynamic backends. Blindly replacing tags with an even very good backend
is not the right direction IMW. Expecting from end users to solve this
problem with add-function :before is unacceptable if there are way to
fix it at Emacs level. 

Different backends can figure different "things-at-point". It would be
wise to try back-ends in turn, just like completion-at-point-functions
does.

As to prompting, if you try to accommodate multiple backends, then
merging completion candidates from multiple backends is a simple task
when you prompt. If you try instead to "bypass the minibuffer" it's
likely to be a much more difficult task.


  Vitalie



  reply	other threads:[~2015-04-26 11:31 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-23 15:07 Bad moves with xref-find-definitions Vitalie Spinu
2015-04-25 14:24 ` Stefan Monnier
2015-04-25 16:25   ` Dmitry Gutov
2015-04-25 17:42   ` Vitalie Spinu
2015-04-25 18:49     ` Vitalie Spinu
2015-04-25 19:07       ` Dmitry Gutov
2015-04-25 18:56     ` João Távora
2015-04-25 23:50       ` Dmitry Gutov
2015-04-26 11:51         ` xref backends for elisp-related modes Was: " João Távora
2015-04-26 13:56           ` Dmitry Gutov
2015-04-26 14:51           ` Eli Zaretskii
2015-04-28 11:06             ` Vitalie Spinu
2015-04-28 11:41               ` João Távora
2015-04-28 11:59                 ` Vitalie Spinu
2015-04-28 15:17                   ` Eli Zaretskii
2015-04-28 15:45                     ` Vitalie Spinu
2015-04-28 16:01                       ` Eli Zaretskii
2015-04-28 13:27                 ` Stefan Monnier
2015-04-28 21:28                   ` Dmitry Gutov
2015-04-29 12:35                     ` Vitalie Spinu
2015-04-29 15:45                     ` Eli Zaretskii
2015-04-28 15:15               ` Eli Zaretskii
2015-04-28 15:47                 ` Vitalie Spinu
2015-04-28 16:03                   ` Eli Zaretskii
2015-04-29  6:55               ` Helmut Eller
2015-04-29 12:40                 ` Vitalie Spinu
2015-04-29 13:01                   ` Helmut Eller
2015-04-29 15:30                     ` Vitalie Spinu
2015-04-29 17:09                       ` Dmitry Gutov
2015-04-29 12:47                 ` Dmitry Gutov
2015-04-29 13:04                   ` Helmut Eller
2015-04-29 13:12                     ` Dmitry Gutov
2015-04-27  2:20           ` Stefan Monnier
2015-04-25 19:11     ` Dmitry Gutov
2015-04-25 20:43       ` Vitalie Spinu
2015-04-26  3:37         ` Dmitry Gutov
2015-04-26  6:38           ` Bozhidar Batsov
2015-04-26 18:41             ` Dmitry Gutov
2015-04-27 19:36               ` Bozhidar Batsov
2015-04-28  1:23                 ` Dmitry Gutov
2015-04-28 11:30               ` Vitalie Spinu
2015-04-26 10:44           ` Vitalie Spinu
2015-04-26 13:14             ` Vitalie Spinu
2015-04-26 15:09             ` Dmitry Gutov
2015-04-26 16:23               ` Vitalie Spinu
2015-04-26 17:51                 ` Dmitry Gutov
2015-04-26 20:56                   ` Vitalie Spinu
2015-04-27 21:57                     ` Dmitry Gutov
2015-04-26  3:34     ` Stefan Monnier
2015-04-26 11:31       ` Vitalie Spinu [this message]
2015-04-26 14:50         ` Eli Zaretskii
2015-04-26 15:12           ` Dmitry Gutov
2015-04-26 15:32             ` Eli Zaretskii
2015-04-26 15:20         ` Dmitry Gutov
2015-04-26 16:01           ` Vitalie Spinu
2015-04-26 17:26             ` Dmitry Gutov
2015-04-27  2:26         ` Stefan Monnier
2015-04-25 19:01 ` Dmitry Gutov
2015-04-25 20:34   ` Vitalie Spinu
2015-04-25 21:44     ` Vitalie Spinu
2015-04-26  0:20     ` Dmitry Gutov
2015-04-26  0:28       ` Dmitry Gutov
2015-04-28 15:31       ` Vitalie Spinu

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

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

  git send-email \
    --in-reply-to=87zj5vm8h3.fsf@gmail.com \
    --to=spinuvit@gmail.com \
    --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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.