help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Navigating an enormous code base


From: Emanuel Berg
Subject: Re: Navigating an enormous code base
Date: Wed, 14 Dec 2022 18:55:11 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Stefan Monnier via Users list for the GNU Emacs text editor wrote:

>> There could be several notions of "sibling":
>> - jump from /foo/bar/main/src/hello.c to /foo/bar/stable/src/hello.c.
>> - jump from /foo/bar/main/src/hello.c to
>> /foo/bar/main/test/src/hello-tests.el.
>> - jump from /foo/bar/main/src/hello.c to /foo/bar/main/src/hello.h.
>
> The function below can do all three given the appropriate hint:
> - "stable" for the first.
> - "-tests" for the second.
> - ".h" for the third.
>
> It can also find "/foo/bar/stable/src/hello.h" when given the hint
> "stable/.h".

So this is the `find-file-dwim' at last?

Good ...

I would do it with several functions that all search for the
file according to their method or algorithm, then they produce
a score and the one with the highest score wins or is
tried first.

After that the file is displayed or a message "is this this
file?" and if it is, obviously it gets displayed but also that
algorithm gets a bonus since it got it right.

That way the "algorithm of algorithms" will be self-learning
and it will also be interesting to the developers, "hey, this
algorithm _never_ gets it right, what's wrong with it?"

However one should also store the exact situation (state,
hint, and correct file) in a database, so if that exact
situation appears again we already know what to do and the
desired file will just be found (a reference to it) in the
database, with no need for any algorithm to execute ...

So the order would be

1. database
2. run algorithm of algorithm
3. algorithms produce score
4. algorithm of algorithm add bonus
5. suggestion presented to user
6. algorithm of algorithm adjusts bonus
7. correct answer inserted into database

But it's up to the developer to do it anyway they like
of course ...

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]