From: Francis Litterio Date: Thu, 4 Feb 2016 05:55:01 +0000 (+1100) Subject: Make /QUIT in erc more robust X-Git-Tag: emacs-25.0.91~93 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8c562b2;p=emacs.git 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). --- 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'.