summaryrefslogtreecommitdiff
path: root/lisp/erc/erc.el
diff options
context:
space:
mode:
authorF. Jason Park <jp@neverwas.me>2022-12-11 19:41:43 -0800
committerF. Jason Park <jp@neverwas.me>2022-12-14 06:40:55 -0800
commit44b04c0ac1caef2283076d0784e0407940c14287 (patch)
treef8f8067b363d87da479221fb85538a0242de33a3 /lisp/erc/erc.el
parent75f26646d4a569cfb485de4baddcda66ff44b2c3 (diff)
downloademacs-44b04c0ac1caef2283076d0784e0407940c14287.tar.gz
Actually accept non-symbols as IDs in erc-open
* lisp/erc/erc.el (erc-generate-new-buffer-name): Despite what it says in the documentation, only symbols were being accepted as valid `:id' entry-point arguments. This uses the interned `princ' representation of the argument instead. * test/lisp/erc/erc-scenarios-base-netid-samenet.el (erc-scenarios-common--base-network-id-same-network): Randomly specify a string for the ID param instead of a non-nil symbol when opening a new connection. * test/lisp/erc/resources/erc-scenarios-common.el (erc-scenarios-common-assert-initial-buf-name): Adjust helper to allow for non-symbol IDs. (Bug#59976.)
Diffstat (limited to 'lisp/erc/erc.el')
-rw-r--r--lisp/erc/erc.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 7e7e142b854..9d811617d2e 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -1607,11 +1607,12 @@ same manner."
(if (and (with-suppressed-warnings ((obsolete erc-reuse-buffers))
erc-reuse-buffers)
id)
- (progn
- (when-let* ((buf (get-buffer (symbol-name id)))
+ (let ((string (symbol-name (erc-networks--id-symbol
+ (erc-networks--id-create id)))))
+ (when-let* ((buf (get-buffer string))
((erc-server-process-alive buf)))
- (user-error "Session with ID %S already exists" id))
- (symbol-name id))
+ (user-error "Session with ID %S already exists" string))
+ string)
(generate-new-buffer-name (if (and server port)
(if (with-suppressed-warnings
((obsolete erc-reuse-buffers))