From: Eli Zaretskii <eliz@gnu.org>
To: Felician Nemeth <felician.nemeth@gmail.com>
Cc: 57325@debbugs.gnu.org
Subject: bug#57325: 27.1; functions in ff-other-file-alist
Date: Sun, 21 Aug 2022 21:55:27 +0300 [thread overview]
Message-ID: <83h725bf4w.fsf@gnu.org> (raw)
In-Reply-To: <87fshpjviu.fsf@betli.tmit.bme.hu> (message from Felician Nemeth on Sun, 21 Aug 2022 20:34:17 +0200)
> From: Felician Nemeth <felician.nemeth@gmail.com>
> Date: Sun, 21 Aug 2022 20:34:17 +0200
>
> First, the documentation of ff-other-file-alist fails to mention that
> the value of the variable does not have to be alist, it can be a symbol
> as well.
Thanks, now fixed on the emacs-28 branch.
> 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.
That's on purpose: this package's design causes such a situation to
make no sense. Imagine that I wrote a C source file and what now to
"find" the corresponding header file. If that header file doesn't
exist, I need to write it and save it. Which is why
ff-find-the-other-file behaves like it does: if the file doesn't
exist, it visits that file as a new one and lets me edit it.
What would you have the package do instead when "the other" file is
not found?
> If the function returns "/nonexistent", then ff-find-the-other-file
> (with the default settings) will try to create "/nonexistent".
>
> If the function returns nil, then ff-find-the-other-file will call
> ff-get-file-name and:
>
> (ff-get-file-name '("." "/usr/include" "/usr/local/include/*") nil nil)
> ==> "/home/nemethf/.emacs.d/News/drafts/drafts/679"
>
> "emacs -Q -l bug.el" reproduces the problem by setting
> uniquify-buffer-name-style. However, my uniquify-buffer-name-style is
> 'forward and not nil. Maybe Gnus changes uniquify-buffer-name-style
> under the hood, because drafts/679 corresponds to a buffer named
> "*sent wide reply to Somebody*<2>".
>
> I tend to think this bug in line 577 of find-file.el:
> http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/find-file.el?id=958924a8126cf532d44c4b446d13ed744438cc9b#n577
> But I don't understand the purpose of that string-match-p.
It looks for buffers which were uniquified. But I don't think I
understand what you don't understand there, nor how that part is
related to the issue you are raising, which AFAIU is that the function
cannot meaningfully signal a failure. Please elaborate.
Thanks.
next prev parent reply other threads:[~2022-08-21 18:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-21 18:34 bug#57325: 27.1; functions in ff-other-file-alist Felician Nemeth
2022-08-21 18:55 ` Eli Zaretskii [this message]
2022-08-21 19:37 ` Felician Nemeth
2022-08-22 11:44 ` Eli Zaretskii
2022-08-25 8:14 ` Eli Zaretskii
2022-08-29 11:57 ` Felician Nemeth
2022-08-29 14:04 ` Eli Zaretskii
2022-08-29 14:27 ` Felician Nemeth
2022-08-29 16:49 ` Eli Zaretskii
2022-08-30 8:46 ` Felician Nemeth
2022-08-30 12:43 ` Eli Zaretskii
2022-08-30 13:48 ` Felician Nemeth
2022-08-30 16:10 ` Eli Zaretskii
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83h725bf4w.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=57325@debbugs.gnu.org \
--cc=felician.nemeth@gmail.com \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).