Recently I migrated from emacs 25 to 26.1. Before I reached the window behaviour, where I could always open a file at the window at point.
The most simple case to illustrate undesired behaviour: I have two split windows. I am calling
find-file (or other alternatives) from the left one, while the new file opens in the right window.
ido-find-file works as desired (opens file at the window at point).
helm-find-file and they all do not open the file in the current window.
I tried to change window-related variables introduced in emacs 26.1; so, relevant emacs config might be here:
(setq pop-up-windows nil switch-to-buffer-preserve-window-point nil switch-to-visible-buffer nil switch-to-buffer-in-dedicated-window t)
Have anybody tackled this issue?
In order to achieve the desired behaviour I used el-patch package with the following lines:
(el-patch-defun find-file (filename &optional wildcards) (interactive (find-file-read-args "Find file: " (confirm-nonexistent-file-or-buffer))) (let ((value (find-file-noselect filename nil nil wildcards))) (if (listp value) (mapcar (el-patch-swap 'pop-to-buffer-same-window 'switch-to-buffer) (nreverse value)) ((el-patch-swap pop-to-buffer-same-window switch-to-buffer) value))))