diff options
author | Chong Yidong <[email protected]> | 2010-10-24 17:36:09 -0400 |
---|---|---|
committer | Chong Yidong <[email protected]> | 2010-10-24 17:36:09 -0400 |
commit | 0c382083b6b550c26fad8ac7f59b1ba09663e728 (patch) | |
tree | 811262fd6093232799dabb83600551ba63cecaac /lisp/erc | |
parent | d77d0953b5ddb05ea7ad19556f37a5f5c4d3a67b (diff) | |
parent | 23c261f58fceed14e04b3ba928007fde9567d8e2 (diff) |
Merge changes from emacs-23
Diffstat (limited to 'lisp/erc')
-rw-r--r-- | lisp/erc/ChangeLog | 7 | ||||
-rw-r--r-- | lisp/erc/erc-backend.el | 51 |
2 files changed, 33 insertions, 25 deletions
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 81bdf5446e..bdc404cc5a 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,10 @@ +2010-10-23 Julien Danjou <[email protected]> + + * erc-backend.el (erc-server-JOIN): Set the correct target list on join. + + * erc-backend.el (erc-process-sentinel): Check that buffer is alive + before setting it as current buffer. + 2010-10-14 Juanma Barranquero <[email protected]> * erc-xdcc.el (erc-xdcc-help-text): Fix typo in docstring. diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 9a237d47d5..46e9d6c8c2 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -653,30 +653,31 @@ Conditionally try to reconnect and take appropriate action." (defun erc-process-sentinel (cproc event) "Sentinel function for ERC process." - (with-current-buffer (process-buffer cproc) - (erc-log (format - "SENTINEL: proc: %S status: %S event: %S (quitting: %S)" - cproc (process-status cproc) event erc-server-quitting)) - (if (string-match "^open" event) - ;; newly opened connection (no wait) - (erc-login) - ;; assume event is 'failed - (let ((buf (process-buffer cproc))) - (erc-with-all-buffers-of-server cproc nil - (setq erc-server-connected nil)) - (when erc-server-ping-handler - (progn (erc-cancel-timer erc-server-ping-handler) - (setq erc-server-ping-handler nil))) - (run-hook-with-args 'erc-disconnected-hook - (erc-current-nick) (system-name) "") - ;; Remove the prompt - (goto-char (or (marker-position erc-input-marker) (point-max))) - (forward-line 0) - (erc-remove-text-properties-region (point) (point-max)) - (delete-region (point) (point-max)) - ;; Decide what to do with the buffer - ;; Restart if disconnected - (erc-process-sentinel-1 event buf))))) + (let ((buf (process-buffer cproc))) + (when (buffer-live-p buf) + (with-current-buffer buf + (erc-log (format + "SENTINEL: proc: %S status: %S event: %S (quitting: %S)" + cproc (process-status cproc) event erc-server-quitting)) + (if (string-match "^open" event) + ;; newly opened connection (no wait) + (erc-login) + ;; assume event is 'failed + (erc-with-all-buffers-of-server cproc nil + (setq erc-server-connected nil)) + (when erc-server-ping-handler + (progn (erc-cancel-timer erc-server-ping-handler) + (setq erc-server-ping-handler nil))) + (run-hook-with-args 'erc-disconnected-hook + (erc-current-nick) (system-name) "") + ;; Remove the prompt + (goto-char (or (marker-position erc-input-marker) (point-max))) + (forward-line 0) + (erc-remove-text-properties-region (point) (point-max)) + (delete-region (point) (point-max)) + ;; Decide what to do with the buffer + ;; Restart if disconnected + (erc-process-sentinel-1 event buf)))))) ;;;; Sending messages @@ -1195,7 +1196,7 @@ add things to `%s' instead." (setq buffer (erc-open erc-session-server erc-session-port nick erc-session-user-full-name nil nil - erc-default-recipients chnl + (list chnl) chnl erc-server-process)) (when buffer (set-buffer buffer) |