unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Engster <deng@randomsample.de>
To: Stephen Leake <stephen_leake@stephe-leake.org>
Cc: emacs-devel@gnu.org
Subject: Re: progmodes/project.el and search paths
Date: Wed, 12 Aug 2015 12:10:34 +0200	[thread overview]
Message-ID: <87k2t0yfz9.fsf@isaac.fritz.box> (raw)
In-Reply-To: <86bnefyu0b.fsf@stephe-leake.org> (Stephen Leake's message of "Mon, 10 Aug 2015 11:43:00 -0500")

Stephen Leake writes:
> David Engster <deng@randomsample.de> writes:
>
>> Stephen Leake writes:
>>> The same problem occurs with any language library projects; if I'm
>>> working on top_project, and need to read the impelementation for a
>>> function that happens to be in library_project_1, they both need to be
>>> in the file completion search path.
>>
>> Say I really want to see the implementation of 'foo' in glibc. I simply
>> load the glibc project into my workspace (to use the Eclipse lingo); it
>> is not a subproject, but simply another project parallel to all the
>> others I have loaded. I can now jump from some Emacs C source file to
>> the 'foo' definition.
>
> Do you have to load glibc manually?

Yes. You can either create a separate project for glibc and add this to
your workspace, or you add the sources of glibc directly to your project
as a special "library source". The latter is what you usually do, unless
you are a glibc developer.

> I would think that would be done for you by the declared dependency.

Since you only need the headers for compilation and the library object
for linking, there's no need for Eclipse to force you to add the
sources. It also cannot add them automatically, because they are usually
not installed in the first place. My current Emacs binary depends on 73
libraries, and AFAIK I have sources for exactly none of them installed.

> So Eclipse implicitly adds all the projects to a single "source search
> path".

Not implicitly; you have to configure that.

> That is what I'm asking for in Emacs project-related searches.
>
> load-path does that for elisp. compilation-search-path does that for
> most language modes.
>
> In Ada mode lingo, that group of projects is one hierarchical project;
> the project definition files define the project hierarchy. Ada mode
> supports having several distict hierarchical projects loaded, but only
> one active.
>
> So that is the source of my confusion.

I see.

>> My guess your issue is that another library might have defined a symbol
>> 'foo' as well, and its project is also loaded in my workspace - then it
>> depends on the #include's in your source file. So here, a project system
>> must ask something like Semantic for the search path of the current
>> file.
>
> Depends on the use case; the user might want to see:
>
> - "all (overloaded) definitions of "foo", in all projects "
>
>     Perhaps to check whether current occurance could be using a
>     different definition. Or to see if the different definitions could
>     be combined, or further refactored.
>
>     This is more useful in languages that explicitly support overloaded
>     symbols (Ada has many definitions of "Put" in its standard library).
>
> - "the definition for _this_ use of "foo", in some project "
>
>     To see what it actually does.
>
> - "all methods for this generic function"
>
>     Similar to the first use case, but limited to one generic function.
>
> So the question now is: what does EDE do for these use cases?

AFAIK, you can only search in the current project. However, your use
cases involve more than just a project system. If you want to search for
overloads or methods, you need a parser as well. This also applies to
the most important feature (at least for me): show all definitions of
'foo' that are currently in scope. EDE has no notions of symbols, scope,
overloading, methods, etc.

It gets much more complicated when you're not only interested in
definitions, but any occurance of a symbol. For instance, you want all
places where 'foo' gets called, but not any 'foo', but the method 'foo'
from class 'bar' and not from any other class.

> The definition of xref-find-definitions is agnostic with respect to
> these use cases; the "identifier" returned by xref--read-identifier can
> be:
>
> - a simple string for the first use case
>
> - a more complex structure (in text properties) that identifies this
>   occurance for the second and third use case
>
> In addition, the backend can use the extra info or ignore it.
>
> But the xref-find-definitions UI doesn't allow the user to express a
> desire for one these uses.

I can't really say much about xref since I haven't really worked with it
yet. The semantic-symref feature is also pretty limited in this
regard. So in the end, I often ended up calling grep or global
directly. All this stuff is highly dependent on the language you're
using. 

> In any case, the "source search path" used by xref-find-definitions
> should include all of the relevant projects, as defined by the project
> dependencies. 

I agree.

-David



  reply	other threads:[~2015-08-12 10:10 UTC|newest]

Thread overview: 101+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-02 13:52 progmodes/project.el and search paths Eric Ludlam
2015-08-02 17:17 ` Dmitry Gutov
2015-08-03  1:19   ` Eric Ludlam
2015-08-03 16:16     ` Stephen Leake
2015-08-03 22:56       ` Dmitry Gutov
2015-08-08 13:07       ` Nix
2015-08-09  5:18         ` Stephen Leake
2015-08-09 12:17           ` David Engster
2015-08-09 15:55             ` Stephen Leake
2015-08-10 11:29               ` David Engster
2015-08-10 16:43                 ` Stephen Leake
2015-08-12 10:10                   ` David Engster [this message]
2015-08-12 13:49                     ` Stephen Leake
2015-08-12 15:36                       ` David Engster
2015-08-13 11:53                         ` Nix
2015-08-13 12:05                           ` Dmitry Gutov
2015-08-14 11:52                             ` Eric Ludlam
2015-08-14 22:30                               ` Dmitry Gutov
2015-08-15  0:48                                 ` Eric Ludlam
2015-08-15  7:05                                 ` Eli Zaretskii
2015-08-10 17:12             ` Nix
2015-08-03 22:47     ` Dmitry Gutov
2015-08-04 11:52       ` Eric Ludlam
2015-08-04 16:09         ` Dmitry Gutov
2015-08-03 13:49   ` David Engster
2015-08-03 14:09     ` Dmitry Gutov
2015-08-03 14:27       ` David Engster
2015-08-03 15:13         ` Dmitry Gutov
2015-08-03 21:35           ` David Engster
2015-08-03 23:21             ` Dmitry Gutov
2015-08-04  8:15               ` David Engster
2015-08-04 13:43               ` Eli Zaretskii
2015-08-04 18:05                 ` Dmitry Gutov
2015-08-04 18:16                   ` Eli Zaretskii
2015-08-04 18:41                     ` Dmitry Gutov
2015-08-04 19:23                       ` Eli Zaretskii
2015-08-04 19:40                         ` João Távora
2015-08-05  2:52                           ` Eli Zaretskii
2015-08-04 20:15                         ` Dmitry Gutov
2015-08-05  2:49                           ` Eli Zaretskii
2015-08-05  6:18                             ` Stephen Leake
2015-08-05 15:08                               ` Eli Zaretskii
2015-08-05 15:36                                 ` Dmitry Gutov
2015-08-05 16:31                                   ` Eli Zaretskii
2015-08-05 16:45                                   ` David Engster
2015-08-05 22:17                                     ` Dmitry Gutov
2015-08-06  7:56                                     ` Stephen Leake
2015-08-06  7:54                                   ` Stephen Leake
2015-08-05  9:42                             ` Dmitry Gutov
2015-08-05 15:23                               ` Eli Zaretskii
2015-08-05 15:31                                 ` Dmitry Gutov
2015-08-05 16:16                                   ` Eli Zaretskii
2015-08-06  6:44                                     ` Dmitry Gutov
2015-08-06  7:43                               ` Stephen Leake
2015-08-06 10:25                                 ` Dmitry Gutov
2015-08-06 14:27                                   ` Stephen Leake
2015-08-06 23:16                                     ` Dmitry Gutov
2015-08-07 14:10                                       ` Stephen Leake
2015-08-07 14:44                                         ` Dmitry Gutov
2015-08-03 16:35         ` Stephen Leake
2015-08-03 16:45           ` Eli Zaretskii
2015-08-03 21:07             ` Stephen Leake
2015-08-03 21:33               ` David Engster
2015-08-04  2:35               ` Eli Zaretskii
2015-08-03 15:09       ` Eli Zaretskii
2015-08-03 15:16         ` Dmitry Gutov
2015-08-03 15:29           ` Eli Zaretskii
2015-08-03 19:01             ` Dmitry Gutov
2015-08-03 19:19               ` Eli Zaretskii
2015-08-03 21:05                 ` Dmitry Gutov
2015-08-04 11:48         ` Eric Ludlam
2015-08-04 16:20           ` Dmitry Gutov
2015-08-03 16:25     ` Stephen Leake
2015-08-03 21:33     ` Stefan Monnier
2015-08-03 22:15       ` David Engster
2015-08-03 22:50         ` Dmitry Gutov
2015-08-04  7:13         ` Stefan Monnier
2015-08-04  8:13           ` David Engster
2015-08-05 13:42             ` Stefan Monnier
2015-08-06 11:27               ` {Spam?} " Eric Ludlam
2015-08-06 23:10                 ` Stefan Monnier
2015-08-07 11:18                   ` Eric Ludlam
2015-08-07 11:43                     ` David Engster
2015-08-07 12:17                       ` Dmitry Gutov
2015-08-07 12:40                         ` David Engster
2015-08-07 12:54                           ` Dmitry Gutov
2015-08-07 12:08                     ` Alexis
2015-08-04  9:40           ` Stephen Leake
2015-08-04 17:43             ` Dmitry Gutov
2015-08-04 19:49               ` Stephen Leake
2015-08-04 20:03                 ` Dmitry Gutov
2015-08-05  6:02                   ` Stephen Leake
2015-08-05  9:59                     ` Dmitry Gutov
2015-08-06  7:25                       ` Stephen Leake
2015-08-07 14:21                         ` Dmitry Gutov
2015-08-05  1:29   ` Eric Ludlam
2015-08-11 20:01     ` Dmitry Gutov
2015-08-12  0:49       ` Eric Ludlam
2015-08-12  7:25         ` project terminology Stephen Leake
2015-08-12  9:28         ` progmodes/project.el and search paths Dmitry Gutov
2015-12-29  2:00     ` Dmitry Gutov

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=87k2t0yfz9.fsf@isaac.fritz.box \
    --to=deng@randomsample.de \
    --cc=emacs-devel@gnu.org \
    --cc=stephen_leake@stephe-leake.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 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).