]> git.eshelyaron.com Git - emacs.git/commitdiff
Use erc-compat analog for window-no-other-p
authorF. Jason Park <jp@neverwas.me>
Fri, 11 Oct 2024 21:25:43 +0000 (14:25 -0700)
committerEshel Yaron <me@eshelyaron.com>
Mon, 14 Oct 2024 17:38:37 +0000 (19:38 +0200)
* 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)

lisp/erc/erc-compat.el
lisp/erc/erc-speedbar.el

index b5b8fbaf8ab9ca45d51962b9a04bd88c91517824..cb40178212592eed1024270a414782ee3654ba95 100644 (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
index a281e13734c04ad8926c951e739cd4b6249c4f21..e8c41a1f239208dda3379ed5e297973748d9422a 100644 (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)