bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#41359: 28.0.50; find-alternate-file cannot rename buffer back on err


From: Eli Zaretskii
Subject: 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@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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]