summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancis Litterio <flitterio@gmail.com>2016-02-04 16:55:01 +1100
committerLars Ingebrigtsen <larsi@gnus.org>2016-02-04 16:55:01 +1100
commit8c562b2d7f6378b71e0dcbc172a4dd6673895256 (patch)
tree906e1bea6d1c592367e901d6a2f7f34f84ec2408
parentd93d2c5b16dc98671a35374ac20fa6f7108f1c7c (diff)
downloademacs-8c562b2d7f6378b71e0dcbc172a4dd6673895256.tar.gz
Make /QUIT in erc more robust
* lisp/erc/erc.el (erc-kill-query-buffers): Don't bug out if we're issuing /QUIT to disconnected servers (bug#22099).
-rw-r--r--lisp/erc/erc.el12
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 3e96bb279e8..51ab20e330a 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -6083,13 +6083,15 @@ If it doesn't exist, create it."
(or (file-accessible-directory-p dir) (error "Cannot access %s" dir)))
(defun erc-kill-query-buffers (process)
- "Kill all buffers of PROCESS."
+ "Kill all buffers of PROCESS.
+Does nothing if PROCESS is not a process object."
;; here, we only want to match the channel buffers, to avoid
;; "selecting killed buffers" b0rkage.
- (erc-with-all-buffers-of-server process
- (lambda ()
- (not (erc-server-buffer-p)))
- (kill-buffer (current-buffer))))
+ (when (processp process)
+ (erc-with-all-buffers-of-server process
+ (lambda ()
+ (not (erc-server-buffer-p)))
+ (kill-buffer (current-buffer)))))
(defun erc-nick-at-point ()
"Give information about the nickname at `point'.