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'.
This commit is contained in:
F. Jason Park 2024-10-11 14:25:43 -07:00
parent 9bddb264ba
commit 6e80509099
2 changed files with 13 additions and 1 deletions

View file

@ -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

View file

@ -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)