aboutsummaryrefslogtreecommitdiffstats
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.el26
1 files changed, 10 insertions, 16 deletions
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index 7dce9e4bf01..5acbcb05ab8 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -493,11 +493,7 @@ action."
493 (if erc-server-quitting 493 (if erc-server-quitting
494 ;; normal quit 494 ;; normal quit
495 (progn 495 (progn
496 (let ((string "\n\n*** ERC finished ***\n") 496 (erc-display-message nil 'error (current-buffer) 'finished)
497 (inhibit-read-only t))
498 (erc-put-text-property 0 (length string)
499 'face 'erc-error-face string)
500 (insert string))
501 (when erc-kill-server-buffer-on-quit 497 (when erc-kill-server-buffer-on-quit
502 (set-buffer-modified-p nil) 498 (set-buffer-modified-p nil)
503 (kill-buffer (current-buffer)))) 499 (kill-buffer (current-buffer))))
@@ -519,12 +515,8 @@ action."
519 (erc erc-session-server erc-session-port erc-server-current-nick 515 (erc erc-session-server erc-session-port erc-server-current-nick
520 erc-session-user-full-name t erc-session-password) 516 erc-session-user-full-name t erc-session-password)
521 ;; terminate, do not reconnect 517 ;; terminate, do not reconnect
522 (let ((string (concat "\n\n*** ERC terminated: " event 518 (erc-display-message nil 'error (current-buffer)
523 "\n")) 519 'terminated ?e event))))
524 (inhibit-read-only t))
525 (erc-put-text-property 0 (length string)
526 'face 'erc-error-face string)
527 (insert string)))))
528 520
529(defun erc-process-sentinel (cproc event) 521(defun erc-process-sentinel (cproc event)
530 "Sentinel function for ERC process." 522 "Sentinel function for ERC process."
@@ -545,6 +537,7 @@ action."
545 (run-hook-with-args 'erc-disconnected-hook 537 (run-hook-with-args 'erc-disconnected-hook
546 (erc-current-nick) (system-name) "") 538 (erc-current-nick) (system-name) "")
547 ;; Remove the prompt 539 ;; Remove the prompt
540 (goto-char (or (marker-position erc-input-marker) (point-max)))
548 (forward-line 0) 541 (forward-line 0)
549 (erc-remove-text-properties-region (point) (point-max)) 542 (erc-remove-text-properties-region (point) (point-max))
550 (delete-region (point) (point-max)) 543 (delete-region (point) (point-max))
@@ -563,11 +556,12 @@ action."
563 "Return the coding system or cons cell appropriate for TARGET. 556 "Return the coding system or cons cell appropriate for TARGET.
564This is determined via `erc-encoding-coding-alist' or 557This is determined via `erc-encoding-coding-alist' or
565`erc-server-coding-system'." 558`erc-server-coding-system'."
566 (or (let ((case-fold-search t)) 559 (or (when target
567 (catch 'match 560 (let ((case-fold-search t))
568 (dolist (pat erc-encoding-coding-alist) 561 (catch 'match
569 (when (string-match (car pat) target) 562 (dolist (pat erc-encoding-coding-alist)
570 (throw 'match (cdr pat)))))) 563 (when (string-match (car pat) target)
564 (throw 'match (cdr pat)))))))
571 (and (functionp erc-server-coding-system) 565 (and (functionp erc-server-coding-system)
572 (funcall erc-server-coding-system)) 566 (funcall erc-server-coding-system))
573 erc-server-coding-system)) 567 erc-server-coding-system))