all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Vitalie Spinu <spinuvit@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org, eller.helmut@gmail.com, dgutov@yandex.ru
Subject: Re: xref-find-matches and stuff
Date: Sat, 09 May 2015 14:32:03 +0200	[thread overview]
Message-ID: <87y4kyhqyk.fsf@gmail.com> (raw)
In-Reply-To: <83a8xep450.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 09 May 2015 11:05:31 +0300")

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

 >>> Eli Zaretskii on Sat, 09 May 2015 11:05:31 +0300 wrote:

 >> > And my point is, the backends should be made well enough that you
 >> > generally won't want to use a symbol from the 2nd backend that isn't
 >> > in the first one. Ideally because there will be no such symbols.
 >> 
 >> I am afraid this is an impossible task.

 > Can you tell why?

In an ideal world you can imagine a tag-like backend that would know all
possible language and would be aware of all the intricacies of multiple
projects that you are working on simultaneously. It would also sniff
through all open files and tag them automatically.

Then, indeed, you won't need Imenu, nor REPL backends. Till such an
universal tool is there, xref itself comes very close to it if imenu,
tags and REPL backends were automatically merged.


 >> - IMENU operates on what I work, is always up-to date, works with
 >> non-programming modes (org, latex etc), non-visiting buffers
 >> (*scratch*) and any project-less file/language what I might open for
 >> whatever cursory reason. Stuff works out of the box - no tagging, no
 >> REPL is required.
 >> 
 >> - REPLs are good, but work only on loaded files. Usually these cannot
 >> work with multiple projects or multi-language projects. Cross
 >> references support is lacking for many REPLs.
 >> 
 >> - TAGs can support multiple projects but cannot do what Imenu can and
 >> will never be as smart as REPLs can be. No support for less common
 >> languages. Limited UI in emacs is a hindrance for common users (I
 >> cannot comment about ggtags though).

 > To me, this means we need to have a single back-end for each
 > situation, and ideally also a mechanism to choose that single
 > back-end automatically.  I see no reasons to conclude that we need
 > more than one in each use case.

Assume a high level language project with no good support for tags (R
for example's sake) which uses C++. REPL backends can give you
references only for loaded code in REPL, tags give you references only
for C++. Imenu gives you references for all open C++ and R files. Your
task is to jump from A to B (plot attached).


[-- Attachment #2: xref.png --]
[-- Type: image/png, Size: 6111 bytes --]

[-- Attachment #3: Type: text/plain, Size: 1382 bytes --]


You and other people seem to assume that given the context of A you can
infer which backend to use in order to jump to B. Unless you you have an
unique symbol at point in A matching B, that's impossible.

If I am in an C++ tutorial which is not tagged (but has Imenu). Assume
no symbol at point. How can xref know if I want to jump to a symbol in
this example file (imenu backend) or a C++ file in my current project
(tags backend)?

Dmitry goes as far as to suggest that even on C-u M-. only one backend
should be completed upon. I just don't see that working at all. With
multi-language projects it's common to have a high level wrapper (foo)
for low level (C_foo) and you would want to jump back and forth from
`foo` to `C_foo`. `C_foo` is probably unique, `foo` is not, and you just
cannot disambiguate the backend only by current context. In R projects I
can even have two different objects with the same name, one in C and one
in R.


There are basically three ways out

  1) merge backends
  2) select the backend before jump
  3) assign each backend to a separate key

IMO, the 3rd is better than the 2nd and I guess it's the current
situation for loads of people.

I have C-. for elisp-xref, M-. for whatever is the default, M-o for
imenu-anywhere and I am seriously thinking about the forth key for etags
because inconsistency with M-. started jarring on me.


  Vitalie

  reply	other threads:[~2015-05-09 12:32 UTC|newest]

Thread overview: 117+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-04  2:45 xref-find-matches and stuff Dmitry Gutov
2015-05-04  9:17 ` Helmut Eller
2015-05-04 12:39   ` Dmitry Gutov
2015-05-04 16:17 ` Eli Zaretskii
2015-05-04 16:37   ` Óscar Fuentes
2015-05-04 16:42     ` Eli Zaretskii
2015-05-04 16:49       ` Óscar Fuentes
2015-05-04 19:09         ` Stefan Monnier
2015-05-04 18:24     ` Dmitry Gutov
2015-05-04 20:27   ` Dmitry Gutov
2015-05-05  7:07     ` Helmut Eller
2015-05-05 13:20       ` Dmitry Gutov
2015-05-06 12:23       ` Dmitry Gutov
2015-05-06 17:45         ` Helmut Eller
2015-05-06 18:21           ` Dmitry Gutov
2015-05-06 18:34             ` Helmut Eller
2015-05-06 20:17               ` Dmitry Gutov
2015-05-05 15:40     ` Eli Zaretskii
2015-05-05 16:10       ` Dmitry Gutov
2015-05-05 16:33         ` Eli Zaretskii
2015-05-05 16:37           ` Dmitry Gutov
2015-05-05 16:45             ` Eli Zaretskii
2015-05-05 16:48               ` Dmitry Gutov
2015-05-05 17:20                 ` Eli Zaretskii
2015-05-05 17:29                   ` Dmitry Gutov
2015-05-05 18:33                     ` Eli Zaretskii
2015-05-05 18:38                       ` Dmitry Gutov
2015-05-05 19:11                         ` Eli Zaretskii
2015-05-05 21:44                           ` Dmitry Gutov
2015-05-06  2:40                             ` Eli Zaretskii
2015-05-06 12:36                               ` Dmitry Gutov
2015-05-06 13:04                                 ` Dmitry Gutov
2015-05-06 15:30                                 ` Eli Zaretskii
2015-05-06 22:37                                   ` Dmitry Gutov
2015-05-07  4:06                                     ` Eli Zaretskii
2015-07-20  1:55                                   ` Dmitry Gutov
2015-07-20 16:09                                     ` Eli Zaretskii
2015-07-14  8:30       ` Andreas Politz
2015-07-14 15:52         ` Dmitry Gutov
2015-07-16 18:59           ` Andreas Politz
2015-07-17  1:49             ` Vaidheeswaran C
2015-07-19 18:00             ` Dmitry Gutov
2015-07-20  8:19               ` Andreas Politz
2015-05-05 14:35 ` Vitalie Spinu
2015-05-05 15:23   ` Dmitry Gutov
2015-05-05 17:17     ` Vitalie Spinu
2015-05-06  0:48       ` Dmitry Gutov
2015-05-06 13:54         ` Vitalie Spinu
2015-05-07  0:09           ` Dmitry Gutov
2015-05-07 12:24             ` Vitalie Spinu
2015-05-08 12:47               ` Dmitry Gutov
2015-05-08 13:02                 ` Francesco Potortì
2015-05-08 17:15                   ` Dmitry Gutov
2015-05-10 12:31                   ` martin rudalics
2015-05-10 14:46                     ` Eli Zaretskii
2015-05-11 10:08                       ` martin rudalics
2015-05-11 15:05                         ` Eli Zaretskii
2015-05-12  9:36                           ` martin rudalics
2015-05-12 16:15                             ` Eli Zaretskii
2015-05-12 16:46                               ` Dmitry Gutov
2015-05-12 17:37                                 ` Eli Zaretskii
2015-05-12 19:57                                   ` Eli Zaretskii
2015-05-12 20:15                                     ` Dmitry Gutov
2015-05-13  2:38                                       ` Eli Zaretskii
2015-05-13 16:23                                         ` Eli Zaretskii
2015-05-14  0:46                                           ` Dmitry Gutov
2015-05-14  2:44                                             ` Eli Zaretskii
2015-05-13  7:33                               ` martin rudalics
2015-05-13 17:28                                 ` Eli Zaretskii
2015-05-14 10:13                                   ` martin rudalics
2015-05-14 15:06                                     ` Eli Zaretskii
2015-05-15 16:44                                       ` martin rudalics
2015-05-15 18:59                                         ` Eli Zaretskii
2015-05-11 15:42                     ` Francesco Potortì
2015-05-08 16:44                 ` Vitalie Spinu
2015-05-08 16:47                   ` Dmitry Gutov
2015-05-08 18:42                     ` Vitalie Spinu
2015-05-08 19:42                       ` Dmitry Gutov
2015-05-08 21:52                         ` Vitalie Spinu
2015-05-09  0:09                           ` Dmitry Gutov
2015-05-09 12:58                             ` Vitalie Spinu
2015-05-11  1:38                               ` Dmitry Gutov
2015-05-09  8:05                           ` Eli Zaretskii
2015-05-09 12:32                             ` Vitalie Spinu [this message]
2015-05-09 13:19                               ` Eli Zaretskii
2015-05-09 13:46                                 ` Vitalie Spinu
2015-05-09 14:03                                   ` Eli Zaretskii
2015-05-09 18:23                                     ` Vitalie Spinu
2015-05-09 18:49                                       ` Eli Zaretskii
2015-05-09 21:12                                         ` Vitalie Spinu
2015-05-09  7:07                       ` Eli Zaretskii
2015-05-09  9:06                         ` Helmut Eller
2015-05-09 10:34                           ` Eli Zaretskii
2015-05-09 11:43                             ` Helmut Eller
2015-05-09 12:20                               ` Eli Zaretskii
2015-05-09 12:31                                 ` Dmitry Gutov
2015-05-09 13:09                                   ` Eli Zaretskii
2015-05-09 12:58                                 ` Dmitry Gutov
2015-05-09 13:22                                   ` Eli Zaretskii
2015-05-09 21:56                                     ` Dmitry Gutov
2015-05-10 14:48                                       ` Eli Zaretskii
2015-05-11 15:37                                         ` maintaining etags Francesco Potortì
2015-05-11 16:50                                           ` Eli Zaretskii
2015-05-12 11:17                                             ` Francesco Potortì
2015-05-12 16:21                                               ` Eli Zaretskii
2015-05-12 17:11                                                 ` Eli Zaretskii
2015-05-12 16:37                                         ` xref-find-matches and stuff Eli Zaretskii
2015-05-11  1:01                         ` Stefan Monnier
2015-05-11  1:46                           ` Dmitry Gutov
2015-05-11 13:59                             ` Stefan Monnier
2015-05-11 15:22                               ` Eli Zaretskii
2015-05-11 14:56                             ` Eli Zaretskii
2015-05-11 20:24                               ` Dmitry Gutov
2015-05-12  2:36                                 ` Eli Zaretskii
2015-05-12 11:08                                   ` Dmitry Gutov
2015-05-12 16:19                                     ` Eli Zaretskii
2015-05-11 14:53                           ` Eli Zaretskii

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=87y4kyhqyk.fsf@gmail.com \
    --to=spinuvit@gmail.com \
    --cc=dgutov@yandex.ru \
    --cc=eliz@gnu.org \
    --cc=eller.helmut@gmail.com \
    --cc=emacs-devel@gnu.org \
    /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.