[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-29 44b04c0ac1 4/7: Actually accept non-symbols as IDs in erc-open
From: |
F. Jason Park |
Subject: |
emacs-29 44b04c0ac1 4/7: Actually accept non-symbols as IDs in erc-open |
Date: |
Wed, 14 Dec 2022 09:44:40 -0500 (EST) |
branch: emacs-29
commit 44b04c0ac1caef2283076d0784e0407940c14287
Author: F. Jason Park <jp@neverwas.me>
Commit: F. Jason Park <jp@neverwas.me>
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.)
---
lisp/erc/erc.el | 9 +++++----
test/lisp/erc/erc-scenarios-base-netid-samenet.el | 3 +++
test/lisp/erc/resources/erc-scenarios-common.el | 2 +-
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 7e7e142b85..9d811617d2 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))
diff --git a/test/lisp/erc/erc-scenarios-base-netid-samenet.el
b/test/lisp/erc/erc-scenarios-base-netid-samenet.el
index 3cd8b7dfa1..1436712251 100644
--- a/test/lisp/erc/erc-scenarios-base-netid-samenet.el
+++ b/test/lisp/erc/erc-scenarios-base-netid-samenet.el
@@ -40,6 +40,9 @@
(erc-server-flood-margin 30)
erc-serv-buf-a erc-serv-buf-b)
+ (when (and id-a (zerop (random 2))) (setq id-a (symbol-name id-a)))
+ (when (and id-b (zerop (random 2))) (setq id-b (symbol-name id-b)))
+
(ert-info ("Connect to foonet with nick tester")
(with-current-buffer
(setq erc-serv-buf-a (erc :server "127.0.0.1"
diff --git a/test/lisp/erc/resources/erc-scenarios-common.el
b/test/lisp/erc/resources/erc-scenarios-common.el
index d77b32984b..57d4658e75 100644
--- a/test/lisp/erc/resources/erc-scenarios-common.el
+++ b/test/lisp/erc/resources/erc-scenarios-common.el
@@ -185,7 +185,7 @@ Dialog resource directories are located by expanding the
variable
(defun erc-scenarios-common-assert-initial-buf-name (id port)
;; Assert no limbo period when explicit ID given
(should (string= (if id
- (symbol-name id)
+ (format "%s" id)
(format "127.0.0.1:%d" port))
(buffer-name))))
- emacs-29 updated (2d96a18cd0 -> 102a3e3b44), F. Jason Park, 2022/12/14
- emacs-29 f0c9088878 6/7: Set erc-network to a "given" ID instead of failing, F. Jason Park, 2022/12/14
- emacs-29 0155fc67be 2/7: Respect a nil erc-session-password when reconnecting, F. Jason Park, 2022/12/14
- emacs-29 9ac80e8a6e 1/7: Add dedicated auth-source section in ERC manual, F. Jason Park, 2022/12/14
- emacs-29 44b04c0ac1 4/7: Actually accept non-symbols as IDs in erc-open,
F. Jason Park <=
- emacs-29 75f26646d4 3/7: ; Be nicer when updating browse-url var in erc-compat, F. Jason Park, 2022/12/14
- emacs-29 102a3e3b44 7/7: Don't send erc-sasl-user as USER command argument, F. Jason Park, 2022/12/14
- emacs-29 09c0c6b2ba 5/7: Limit casemapping to appropriate ranges in ERC, F. Jason Park, 2022/12/14