Subject: bug#74504: 31.0.50; Wrong source directory in *Help*

From: Stefan Monnier <[email-masked]>
Date: Fri, 13 Dec 2024 17:51:31 -0500

> I think that the workaround Stefan suggests makes sense.

Pushed a slightly tweaked patch to `master`.

> It doesn't make the code (and the implicit assumptions about when
> a file name is absolute and when it isn't) any clearer though.
> Another option may be something like the following, where we
> explicitly look only for .el files under load-path:

AFAICT the other parts of the code treat specially the C files rather
than the ELisp files.  Not sure if it matters (e.g. for `.so` Emacs
modules?), but I'd rather try and use the same hack here as elsewhere.

FWIW, the other place I find this distinction is
`find-function-search-for-symbol` where we do:

    (if (string-match "\\`src/\\(.*\\.\\(c\\|m\\)\\)\\'" library)
        (find-function-C-source symbol (match-string 1 library) type)

And the `src/*.c` strings come from `help-C-file-name`.

We should label those strings better in order to know more reliably
whether they're supposed to be searched in `load-path` or in
`find-function-S-source-directory` or god knows where else.

But in the mean time, this specific bug is fixed.

        Stefan