I have a number of macros for browsing source code for many emacs versions. I wrote this in 2009 and it's been solid until upgrading to U18.04. I know it worked in U16.04:
(defun get-file-from-buffer-other-window () "Load a file into another window referenced by the string on the current line" (interactive) ;; get the filename and lineno (setq vals (get-fileline)) (print vals) ;; load the filename into the next window and goto linenumber (switch-to-buffer-other-window (find-file-noselect (nth 0 vals))) (goto-line (nth 1 vals)) )
I split a frame and have a file list in one window, select a file from the list, which loads it into a buffer and loads the buffer in the other window. Two windows in the frame.
In the new version 25.2.2, the default behavior changed. Now selecting a file opens a NEW window in the frame. Look at five files (key bind to f8) and five new windows are created. I traced the issue to the windows.el display-buffer macro. There is a tuning action named display-buffer-base-action. I try changing the behavior, specifically to display-buffer-reuse-window but cannot get it to recreate the behavior emacs has defaulted since I wrote it in 2009. WTF?
Any ideas? I'm sure it is something to do with display-buffer-reuse-window and this documentation. https://www.gnu.org/software/emacs/manual/html_node/elisp/Precedence-of-Action-Functions.html
Dave