all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg <incal@dataswamp.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Navigating an enormous code base
Date: Wed, 14 Dec 2022 18:55:11 +0100	[thread overview]
Message-ID: <87pmclswe8.fsf@dataswamp.org> (raw)
In-Reply-To: jwvedt28xf7.fsf-monnier+emacs@gnu.org

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	other threads:[~2022-12-14 17:55 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-26  2:31 Navigating an enormous code base John Yates
2022-04-26  6:06 ` Daniel Fleischer
2022-04-26 11:03 ` Eli Zaretskii
2022-04-26 12:53   ` John Yates
2022-04-26 14:06     ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-04-26 12:49 ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-12-14  3:47   ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-12-14 17:55     ` Emanuel Berg [this message]
2022-04-27  7:59 ` Marcus Harnisch
2022-04-27  8:36   ` mrf
2022-04-27 16:35     ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-04-27 22:59       ` John Yates
2022-04-28  0:46         ` Emanuel Berg
2022-04-28  6:42         ` Marcus Harnisch
2022-04-28  7:39           ` Leo Liu
2022-04-28  8:38             ` Marcus Harnisch
2022-04-28 10:45               ` Leo Liu
2022-04-28 14:34               ` John Yates
2022-04-28 14:45                 ` Marcus Harnisch
2022-04-28 14:30           ` John Yates
2022-04-28 14:40             ` Marcus Harnisch
2022-04-28 14:50           ` John Yates
2022-04-28 16:10             ` Óscar Fuentes
2022-04-28 16:15             ` Marcus Harnisch

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=87pmclswe8.fsf@dataswamp.org \
    --to=incal@dataswamp.org \
    --cc=help-gnu-emacs@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.