* lisp/files.el (find-alternate-file): Use selected-window even if dedicated
This commit is contained in:
parent
559d685f68
commit
623d37a1f2
1 changed files with 5 additions and 1 deletions
|
@ -1801,7 +1801,11 @@ killed."
|
|||
(setq buffer-file-truename nil)
|
||||
;; Likewise for dired buffers.
|
||||
(setq dired-directory nil)
|
||||
(find-file filename wildcards))
|
||||
;; Don't use `find-file' because it may end up using another window
|
||||
;; in some corner cases, e.g. when the selected window is
|
||||
;; softly-dedicated.
|
||||
(let ((newbuf (find-file-noselect filename wildcards)))
|
||||
(switch-to-buffer newbuf)))
|
||||
(when (eq obuf (current-buffer))
|
||||
;; This executes if find-file gets an error
|
||||
;; and does not really find anything.
|
||||
|
|
Loading…
Add table
Reference in a new issue