GNU bug report logs - #57325
27.1; functions in ff-other-file-alist

Previous Next

Package: emacs;

Reported by: Felician Nemeth <felician.nemeth <at> gmail.com>

Date: Sun, 21 Aug 2022 18:35:01 UTC

Severity: normal

Found in version 27.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#57325: closed (27.1; functions in ff-other-file-alist)
Date: Tue, 30 Aug 2022 16:11:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Tue, 30 Aug 2022 19:10:19 +0300
with message-id <83zgflu2z8.fsf <at> gnu.org>
and subject line Re: bug#57325: 27.1; functions in ff-other-file-alist
has caused the debbugs.gnu.org bug report #57325,
regarding 27.1; functions in ff-other-file-alist
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
57325: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=57325
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Felician Nemeth <felician.nemeth <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.1; functions in ff-other-file-alist
Date: Sun, 21 Aug 2022 20:34:17 +0200
[Message part 3 (text/plain, inline)]
[There is a simple reproducer at end of the bug report.]

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.

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.

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.

Thanks.

[bug.el (application/emacs-lisp, attachment)]
[Message part 5 (text/plain, inline)]

In GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)
 of 2021-03-28, modified by Debian built on x86-conova-01
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Debian GNU/Linux 11 (bullseye)

[Message part 6 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Felician Nemeth <felician.nemeth <at> gmail.com>
Cc: 57325-done <at> debbugs.gnu.org
Subject: Re: bug#57325: 27.1; functions in ff-other-file-alist
Date: Tue, 30 Aug 2022 19:10:19 +0300
> From: Felician Nemeth <felician.nemeth <at> gmail.com>
> Cc: 57325 <at> debbugs.gnu.org
> Date: Tue, 30 Aug 2022 15:48:44 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > But then I think we should replace this code in ff-get-file-name:
> >
> >               (setq file (concat dir "/" filename))
> > with
> >               (setq file (expand-file-name filename dir))
> >
> > and then the code will work with absolute file names as well, even if
> > the file is not already visited in a buffer.  Right?
> 
> Yes, I think that's right.

Done.

> The latest documentation still has this:
> 
>    Note: if an element of the alist names a FUNCTION as its cdr, that
>    function must return a non-nil list of file-name extensions.  It
>    cannot return nil, nor can it signal in any way a failure to find a
>    suitable list of extensions.
> 
> The end of the first sentence should be "file-names."  Then I think this
> bug report can be closed.

Fixed, and closing.

Thanks a lot for your help.


This bug report was last modified 2 years and 327 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.