summaryrefslogtreecommitdiff
path: root/lisp/erc/erc-backend.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/erc/erc-backend.el')
-rw-r--r--lisp/erc/erc-backend.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index 3ea0f74eed7..7dce9e4bf01 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -563,7 +563,11 @@ action."
"Return the coding system or cons cell appropriate for TARGET.
This is determined via `erc-encoding-coding-alist' or
`erc-server-coding-system'."
- (or (cdr (assoc target erc-encoding-coding-alist))
+ (or (let ((case-fold-search t))
+ (catch 'match
+ (dolist (pat erc-encoding-coding-alist)
+ (when (string-match (car pat) target)
+ (throw 'match (cdr pat))))))
(and (functionp erc-server-coding-system)
(funcall erc-server-coding-system))
erc-server-coding-system))
@@ -849,8 +853,10 @@ Finds hooks by looking in the `erc-server-responses' hashtable."
(let ((hook (or (erc-get-hook (erc-response.command message))
'erc-default-server-functions)))
(run-hook-with-args-until-success hook process message)
- (with-current-buffer (erc-server-buffer)
- (run-hook-with-args 'erc-timer-hook (erc-current-time)))))
+ (let ((server-buffer (erc-server-buffer)))
+ (when (buffer-live-p server-buffer)
+ (with-current-buffer server-buffer
+ (run-hook-with-args 'erc-timer-hook (erc-current-time)))))))
(add-hook 'erc-default-server-functions 'erc-handle-unknown-server-response)