all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 32034@debbugs.gnu.org
Subject: bug#32034: 26.1; [PACTH] better xref-location-marker for imperfect file locations
Date: Tue, 3 Jul 2018 16:43:26 +0100	[thread overview]
Message-ID: <CALDnm52Ay=DTYebh1j=86E8=iminsn-UXkNMr+H-dbWYYrnP3w@mail.gmail.com> (raw)
In-Reply-To: <eb06fbb5-89e1-9cf4-2c1e-337f41ab6553@yandex.ru>

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

On Tue, Jul 3, 2018, 16:07 Dmitry Gutov <dgutov@yandex.ru> wrote:

> On 7/3/18 5:50 PM, João Távora wrote:
>
> > Right, this should go into xref-goto-xref (or whatever it is called) or
> > xref-find-definitions.  Or scratched, if it's too much work, because
> > it's not terribly useful.
>
> I'm sure it will be useful in some situations, I'm just not sure about
> the odds.
>
> > In that special case we will do no worse than the current version,
> > wouldn't we?
>
> We would.
>
> Say, we're looking for clojure.core/cons, and the marker leads us to
> "(defn cons" (the example is largely made up). The code looks for
> clojure.core/cons, doesn't find it, and signals an error (will it?).
>

No, no error. Stays put. So no worse.

>
> Or worse, searches around and finds a verbatim reference to
> clojure.core/cons in a docstring somewhere in that file, and returns
> *that* location.
>

We could avoid that (particulary far fetched) case (and the string case) by
checking syntax.


> > At this point, I'm thinking of dismissing the whole thing, and voting to
> > deprecate xref-file-location entirely. Nobody uses it and Eglot will
> > probably use something else before this issue is solved.
>
> Err, it is used: in xref--collect-matches-1. And through it, in
> xref-collect-matches and xref-collect-references.
>

Oh, I must have misgrepped then. Excuse my ignorance, but are these
grep-like tools? If so, they shouldn't ever suffer from the "outdated"
malaise, right?

>
> > It's a shame
> > we can't share code, but if we can't give a default class any kind of
> > useful behavior, we might as well not have this class in the first place.
>
> We could. As long as we don't default to the identifier, and the backend
> has to explicitly provide the hint, we could be fine.
>

I guess a new xref-hinted-location subclass would be the way to go, if not
too much work.  But still think we should do something by default that will
do just as bad on the worst case. And if we use a new subclass, we're
guaranteed that.

>

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

  reply	other threads:[~2018-07-03 15:43 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-02 13:46 bug#32034: 26.1; [PACTH] better xref-location-marker for imperfect file locations João Távora
2018-07-02 14:35 ` Robert Pluim
2018-07-02 15:22   ` João Távora
2018-07-02 14:47 ` Eli Zaretskii
2018-07-02 15:28   ` João Távora
2018-07-02 15:37     ` Eli Zaretskii
2018-07-02 15:50       ` João Távora
2018-07-02 16:32         ` Eli Zaretskii
2018-07-02 16:55           ` João Távora
2018-07-02 17:29             ` Eli Zaretskii
2020-08-10 12:59               ` Lars Ingebrigtsen
2020-08-10 18:53                 ` Dmitry Gutov
2020-08-10 20:42                   ` João Távora
2018-07-03 13:56 ` Dmitry Gutov
2018-07-03 14:50   ` João Távora
2018-07-03 15:07     ` Dmitry Gutov
2018-07-03 15:43       ` João Távora [this message]
2018-07-04 12:58         ` Dmitry Gutov
2018-07-04 13:37           ` João Távora
2018-07-04 14:33             ` Dmitry Gutov
2018-07-04 14:53               ` João Távora
2018-07-04 15:08                 ` Dmitry Gutov
2018-07-04 19:16                   ` João Távora

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='CALDnm52Ay=DTYebh1j=86E8=iminsn-UXkNMr+H-dbWYYrnP3w@mail.gmail.com' \
    --to=joaotavora@gmail.com \
    --cc=32034@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    /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.