1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Use helper to get erc-networks--id symbol as string

* lisp/erc/erc-networks.el (erc-networks--id-string): New function.
(erc-networks--construct-target-buffer-name)
(erc-networks--ensure-unique-server-buffer-name)
(erc-networks--rename-server-buffer): Use it.
* lisp/erc/erc-nicks.el (erc-nicks-list-faces): Use it.
* lisp/erc/erc-status-sidebar.el (erc-status-sidebar-pad-hierarchy): Use it.
* lisp/erc/erc.el (erc-generate-new-buffer-name)
(erc-log-irc-protocol)
(erc--auth-source-determine-params-defaults)
(erc-format-target-and/or-network): Use it.
* test/lisp/erc/erc-networks-tests.el (erc-networks--id-string): New test.
This commit is contained in:
F. Jason Park 2024-11-14 00:28:35 -08:00
parent d25689d6e2
commit 7fc048ca77
5 changed files with 26 additions and 19 deletions

View file

@ -76,6 +76,14 @@
:symbol 'fake.chat)))))
(kill-buffer))))
(ert-deftest erc-networks--id-string ()
(should (equal (erc-networks--id-string (erc-networks--id-fixed-create 'foo))
"foo"))
(should (equal (let* ((erc-network 'FooNet)
(erc-server-current-nick "Joe")) ; needs letstar
(erc-networks--id-string (erc-networks--id-create nil)))
"FooNet")))
(ert-deftest erc-networks--id-create ()
(cl-letf (((symbol-function 'float-time)
(lambda (&optional _) 0.0)))