GNU bug report logs - #41359
28.0.50; find-alternate-file cannot rename buffer back on error from find-file-hook

Previous Next

Package: emacs;

Reported by: immerrr <immerrr <at> gmail.com>

Date: Sun, 17 May 2020 12:52:01 UTC

Severity: normal

Tags: patch

Found in version 28.0.50

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

Bug is archived. No further changes may be made.

Full log


Message #10 received at 41359-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: immerrr <immerrr <at> gmail.com>
Cc: 41359-done <at> debbugs.gnu.org
Subject: Re: bug#41359: 28.0.50;
 find-alternate-file cannot rename buffer back on error from
 find-file-hook
Date: Sat, 30 May 2020 15:27:22 +0300
> From: immerrr <immerrr <at> gmail.com>
> Date: Sun, 17 May 2020 14:51:09 +0200
> 
> 
> find-alternate-file cannot recover from a failure in one of the
> `find-file-hooks', because it doesn't expect a buffer called `oname' to
> exist if `find-file-noselect' returns nil. Here's a simple repro that
> shows the failure starting from 'emacs -Q':
> 
> (find-file "test.txt")
> (add-to-list 'find-file-hook (lambda () (error "ffh failure")))
> (find-alternate-file (buffer-file-name))
> 
> It will leave the buffer visiting test.txt called " **lose**" and
> display an error message saying "Buffer name `test.txt' is in use.".
> 
> I'm attaching a simple patch that would fix this behaviour:

Thanks, I installed this on the master branch.




This bug report was last modified 4 years and 353 days ago.

Previous Next


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