Subject: bug#38677: 26.3; `display-buffer-reuse-mode-window' doesn't check for derived modes

From: Trevor Murphy <[email-masked]>
Date: Thu, 19 Dec 2019 12:37:40 -0800

The problem is in the middle of the function:

        (let ((mode?
               (with-current-buffer (window-buffer window)
                 (cond ((memq major-mode allowed-modes)
                        'same)
                       ((derived-mode-p allowed-modes) ; <= this line
                        'derived)))))
                        ...)

`allowed-modes' is always a list at this point, but `derived-mode-p'
expects each mode as a separated argument (it takes them with an &rest
parameter).  So this call always fails.