mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-13 16:38:14 +00:00
Minor fix in 'find-alternate-file'
This fixes the use case when, for example, 'find-file-hooks' fails. * lisp/files.el (find-alternate-file): If buffer 'oname' exists, kill it before renaming the new one. (Bug#41359)
This commit is contained in:
parent
360d7c716d
commit
3dbe6530b1
@ -1921,6 +1921,8 @@ killed."
|
||||
(setq buffer-file-truename otrue)
|
||||
(setq dired-directory odir)
|
||||
(lock-buffer)
|
||||
(if (get-buffer oname)
|
||||
(kill-buffer oname))
|
||||
(rename-buffer oname)))
|
||||
(unless (eq (current-buffer) obuf)
|
||||
(with-current-buffer obuf
|
||||
|
Loading…
Reference in New Issue
Block a user