unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Fran Litterio <flitterio@gmail.com>
To: 23700@debbugs.gnu.org
Subject: bug#23700: Patch to fix erc-kill-channel sending command to server when no connection
Date: Sun, 5 Jun 2016 17:47:58 +0000 (UTC)	[thread overview]
Message-ID: <loom.20160605T194222-397@post.gmane.org> (raw)

In the latest Emacs sources, function erc-default-target returns
nil when ERC is no longer connected to the server for the current
ERC buffer.  This can cause erc-kill-channel to try to send a
command to the disconnected server when a channel buffer is killed.
This patch fixes that.
--
Fran Litterio


diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 8501e2c..da5edf1 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -6735,9 +6735,10 @@ This function should be on `erc-kill-server-hook'."
 This function should be on `erc-kill-channel-hook'."
   (when (erc-server-process-alive)
     (let ((tgt (erc-default-target)))
-      (erc-server-send (format "PART %s :%s" tgt
-                               (funcall erc-part-reason nil))
-                       nil tgt))))
+      (if tgt
+         (erc-server-send (format "PART %s :%s" tgt
+                                  (funcall erc-part-reason nil))
+                          nil tgt)))))
 
 ;;; Dealing with `erc-parsed'
 







             reply	other threads:[~2016-06-05 17:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-05 17:47 Fran Litterio [this message]
2017-04-18  0:32 ` bug#23700: Patch to fix erc-kill-channel sending command to server when no connection Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20160605T194222-397@post.gmane.org \
    --to=flitterio@gmail.com \
    --cc=23700@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).