Subject: Re: bug#57325: 27.1; functions in ff-other-file-alist

From: Felician Nemeth <[email-masked]>
Date: Sun, 21 Aug 2022 21:37:31 +0200

> Thanks, now fixed on the emacs-28 branch.

Thank you.

>> More importantly, if the associated value is a function, then there's no
>> way for the function to signal that it cannot find a related file.

> What would you have the package do instead when "the other" file is
> not found?

Most probably I just failed to understand that my-find-related-file
should not return nil and, as you say, it cannot meaningfully signal a
failure.  If this is the case, this bug can be closed and I'm sorry for
the noise.

I got confused because if I remove the
(setq uniquify-buffer-name-style nil) line from bug.el, then
ff-find-related-file will open the parent directory of xref.el, which
feels correct.  However, with that line setting
uniquify-buffer-name-style, ff-find-related-file selects /tmp/dir/1234,
which feels wrong because that buffer has nothing to do with xref.el.

In my case, a file can contain a link to another file (a .toml file to a
schema file).  I wasn't sure what to do when the original file did not
contain a link.  Maybe my-find-related-file should ask the user what to
do in this case, or just do a (user-error "There's no related file.").

Thanks again.