aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp
diff options
context:
space:
mode:
authorF. Jason Park2024-05-21 05:37:39 -0700
committerF. Jason Park2024-05-27 16:39:18 -0700
commit1b633ea59ad7f27263bf2a74ecc0e7d048b5eab5 (patch)
tree3e5c33d5ee1063ba47c35c72184edd6f4f6ec7a1 /test/lisp
parent8c54a79ec10d21cfc961476d85db06b643260e38 (diff)
downloademacs-1b633ea59ad7f27263bf2a74ecc0e7d048b5eab5.tar.gz
emacs-1b633ea59ad7f27263bf2a74ecc0e7d048b5eab5.zip
Delete original speedbar frame in erc-nickbar-mode
* lisp/erc/erc-speedbar.el (erc-speedbar-buttons): Disable `erc-nickbar-mode' when it's not displayed in a window. (erc-speedbar--highlight-self-and-ops): Check `status' slot of `erc-channel-user' object instead of calling accessors. (erc-speedbar--hidden-speedbar-frame) (erc-speedbar--emulate-speedbar): Add doc string. (erc-speedbar--handle-delete-frame): New function. (erc-speedbar--toggle-nicknames-sidebar): Remove function because its conditional logic was needlessly complicated and is no longer needed. (erc-speedbar--ensure): Create `speedbar-buffer' when needed, and delete the original frame, but still keep a reference to it in `erc-speedbar--hidden-speedbar-frame'. Set `dframe-delete-frame-function' to own handler. (erc-speedbar--shutting-down-p): Remove unused variable. (erc-speedbar--run-timer-on-post-insert) (erc-speedbar--prod-dframe-timer): Rename former to latter. Return nil, and accept any number of args. (erc-nickbar-mode, erc-nickbar-disable): Tear down completely when disabling, regardless of universal argument. This changes user-facing behavior that was originally introduced with this module as part of bug#63595. Run `erc-speedbar--prod-dframe-timer' on `erc-server-PONG-functions' as well as `erc-insert-post-hook' so that the panel will eventually update if no messages are being received. (erc-speedbar--dframe-controlled): Don't make frame visible because it's been deleted and was never made invisible. * test/lisp/erc/erc-scenarios-status-sidebar.el (erc-scenarios-status-sidebar--nickbar): Update assertions.
Diffstat (limited to 'test/lisp')
-rw-r--r--test/lisp/erc/erc-scenarios-status-sidebar.el16
1 files changed, 9 insertions, 7 deletions
diff --git a/test/lisp/erc/erc-scenarios-status-sidebar.el b/test/lisp/erc/erc-scenarios-status-sidebar.el
index 2523ff9ee46..4cec00e2312 100644
--- a/test/lisp/erc/erc-scenarios-status-sidebar.el
+++ b/test/lisp/erc/erc-scenarios-status-sidebar.el
@@ -98,12 +98,14 @@
98(defvar erc-nickbar-mode) 98(defvar erc-nickbar-mode)
99(defvar speedbar-buffer) 99(defvar speedbar-buffer)
100 100
101;; FIXME move to own file because it takes 20+ seconds, uncompiled.
101(ert-deftest erc-scenarios-status-sidebar--nickbar () 102(ert-deftest erc-scenarios-status-sidebar--nickbar ()
102 :tags `(:expensive-test :unstable ,@(and (getenv "ERC_TESTS_GRAPHICAL") 103 :tags `(:expensive-test :unstable ,@(and (getenv "ERC_TESTS_GRAPHICAL")
103 '(:erc--graphical))) 104 '(:erc--graphical)))
104 (when noninteractive (ert-skip "Interactive only")) 105 (when (and noninteractive (= emacs-major-version 27))
106 (ert-skip "Hangs on Emacs 27, asking for input"))
105 107
106 (erc-scenarios-common-with-cleanup 108 (erc-scenarios-common-with-noninteractive-in-term
107 ((erc-scenarios-common-dialog "base/gapless-connect") 109 ((erc-scenarios-common-dialog "base/gapless-connect")
108 (erc-server-flood-penalty 0.1) 110 (erc-server-flood-penalty 0.1)
109 (erc-server-flood-penalty erc-server-flood-penalty) 111 (erc-server-flood-penalty erc-server-flood-penalty)
@@ -156,14 +158,14 @@
156 ;; etc. for testing commands that call those same functions. 158 ;; etc. for testing commands that call those same functions.
157 (call-interactively #'erc-nickbar-mode) 159 (call-interactively #'erc-nickbar-mode)
158 (should-not erc-nickbar-mode) 160 (should-not erc-nickbar-mode)
159 (should-not (and speedbar-buffer 161 (should-not speedbar-buffer)
160 (get-buffer-window speedbar-buffer))) 162 (should-not (get-buffer " SPEEDBAR"))
161 (should speedbar-buffer)
162 163
163 (erc-nickbar-mode +1) 164 (erc-nickbar-mode +1)
164 (should (and speedbar-buffer 165 (should (and speedbar-buffer (get-buffer-window speedbar-buffer)))
165 (get-buffer-window speedbar-buffer))) 166 (should (eq speedbar-buffer (get-buffer " SPEEDBAR")))
166 (should (get-buffer " SPEEDBAR")) 167 (should (get-buffer " SPEEDBAR"))
168
167 (erc-nickbar-mode -1) 169 (erc-nickbar-mode -1)
168 (should-not (get-buffer " SPEEDBAR")) 170 (should-not (get-buffer " SPEEDBAR"))
169 (should-not erc-nickbar-mode) 171 (should-not erc-nickbar-mode)