[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Erc-commit] [commit][emacs22] erc-process-sentinel: Update mode line in
From: |
mwolson |
Subject: |
[Erc-commit] [commit][emacs22] erc-process-sentinel: Update mode line in more places |
Date: |
Sun, 14 Oct 2007 00:49:10 -0400 |
commit 18b157ee2779760f01507f67f7419f738dd5f20b
Author: Michael W. Olson <address@hidden>
Date: Sun Aug 19 23:02:37 2007 -0400
erc-process-sentinel: Update mode line in more places
* erc-backend.el (erc-process-sentinel-2, erc-process-sentinel-1)
(erc-process-sentinel): Update mode line in more places. Unmark buffer
as modified in more places.
diff --git a/erc-backend.el b/erc-backend.el
index 0df2776..4e25049 100644
--- a/erc-backend.el
+++ b/erc-backend.el
@@ -612,7 +612,8 @@ EVENT is the message received from the closed connection
process."
(defun erc-process-sentinel-2 (event buffer)
"Called when `erc-process-sentinel-1' has detected an unexpected disconnect."
- (when (buffer-live-p buffer)
+ (if (not (buffer-live-p buffer))
+ (erc-update-mode-line)
(with-current-buffer buffer
(let ((reconnect-p (erc-server-reconnect-p event)))
(erc-display-message nil 'error (current-buffer)
@@ -620,8 +621,12 @@ EVENT is the message received from the closed connection
process."
'disconnected-noreconnect))
(if (not reconnect-p)
;; terminate, do not reconnect
- (erc-display-message nil 'error (current-buffer)
- 'terminated ?e event)
+ (progn
+ (erc-display-message nil 'error (current-buffer)
+ 'terminated ?e event)
+ ;; Update mode line indicators
+ (erc-update-mode-line)
+ (set-buffer-modified-p nil))
;; reconnect
(condition-case err
(progn
@@ -652,8 +657,11 @@ Conditionally try to reconnect and take appropriate
action."
;; normal quit
(progn
(erc-display-message nil 'error (current-buffer) 'finished)
+ ;; Update mode line indicators
+ (erc-update-mode-line)
+ ;; Kill server buffer if user wants it
+ (set-buffer-modified-p nil)
(when erc-kill-server-buffer-on-quit
- (set-buffer-modified-p nil)
(kill-buffer (current-buffer))))
;; unexpected disconnect
(erc-process-sentinel-2 event buffer))))
@@ -683,12 +691,7 @@ Conditionally try to reconnect and take appropriate
action."
(delete-region (point) (point-max))
;; Decide what to do with the buffer
;; Restart if disconnected
- (erc-process-sentinel-1 event buf)
- ;; Make sure we don't write to the buffer if it has been
- ;; killed
- (when (buffer-live-p buf)
- (erc-update-mode-line)
- (set-buffer-modified-p nil))))))
+ (erc-process-sentinel-1 event buf)))))
;;;; Sending messages
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Erc-commit] [commit][emacs22] erc-process-sentinel: Update mode line in more places,
mwolson <=