From: F. Jason Park Date: Fri, 11 Oct 2024 21:25:43 +0000 (-0700) Subject: Use erc-compat analog for window-no-other-p X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=89700c93fe1baabd8684168f326c190976395fea;p=emacs.git Use erc-compat analog for window-no-other-p * lisp/erc/erc-compat.el (erc-compat--window-no-other-p): New function. * lisp/erc/erc-speedbar.el (erc-speedbar-toggle-nicknames-window-lock): Use compat adapter for `window-no-other-p'. (cherry picked from commit 6e80509099e27e237787186f4e8731bfdfb9b00d) --- diff --git a/lisp/erc/erc-compat.el b/lisp/erc/erc-compat.el index b5b8fbaf8ab..cb401782125 100644 --- a/lisp/erc/erc-compat.el +++ b/lisp/erc/erc-compat.el @@ -440,6 +440,18 @@ fallback." `(or ,v ""))))) spec))))) + +;;;; Misc 31.1 + +(defun erc-compat--window-no-other-p (window) + ;; See bug#73706. + (if (fboundp 'window-no-other-p) + (window-no-other-p window) + (setq window (window-normalize-window window t)) + (and (not ignore-window-parameters) + (window-parameter window 'no-other-window)))) + + (provide 'erc-compat) ;;; erc-compat.el ends here diff --git a/lisp/erc/erc-speedbar.el b/lisp/erc/erc-speedbar.el index a281e13734c..e8c41a1f239 100644 --- a/lisp/erc/erc-speedbar.el +++ b/lisp/erc/erc-speedbar.el @@ -652,7 +652,7 @@ unlock the window." (when-let ((window (get-buffer-window speedbar-buffer))) (let ((val (cond ((natnump arg) t) ((integerp arg) nil) - (t (not (window-no-other-p window)))))) + (t (not (erc-compat--window-no-other-p window)))))) (with-current-buffer speedbar-buffer (setq cursor-type (not val))) (set-window-parameter window 'no-other-window val)