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

From: Eshel Yaron <[email-masked]>
Date: Sun, 24 Nov 2024 08:12:39 +0100

Hi,

I think that commit e807d62c leads to the following regression:

1. Build Emacs
2. Run src/emacs -Q
3. In the *scratch* buffer say M-x cd /tmp
   (/tmp here is just an arbitrary directory that is not the Emacs
   sources directory)
4. C-h f make-overlay
   Now the first line in the *Help* buffer says:
   "make-overlay is a primitive-function in ‘C source code’."
   So far so good.
5. Switch to the *Help* buffer and type s, this finds buffer.c
6. Switch back to the *Help* buffer and type g
   The first line in *Help* now says:
   "make-overlay is a primitive-function in ‘/tmp/src/buffer.c’."
                                             ^^^^^ <-- Wrong!
                            
Note that the reported file name starts with whatever default-directory
happens to be in the *Help* buffer, which is incorrect.  Before commit
e807d62c, we'd get a file name relative to source-directory, so just
src/buffer.c in this case.

Best,

Eshel