From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?B?Q8OpZHJpYyBDaMOpcGllZA==?= Newsgroups: gmane.emacs.devel Subject: Re: ERC: [PATCH] use network name for server buffer name Date: Fri, 25 Jul 2014 08:32:55 +0200 Message-ID: <53d1fa19.e55bc20a.255f.42a7@mx.google.com> References: <874my72avb.wl%kwhite@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1406270021 14728 80.91.229.3 (25 Jul 2014 06:33:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Jul 2014 06:33:41 +0000 (UTC) Cc: emacs-devel@gnu.org To: Kelvin White Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 25 08:33:34 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XAZ4M-0003Q3-8x for ged-emacs-devel@m.gmane.org; Fri, 25 Jul 2014 08:33:30 +0200 Original-Received: from localhost ([::1]:53235 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XAZ4L-0007Mi-Ll for ged-emacs-devel@m.gmane.org; Fri, 25 Jul 2014 02:33:29 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42540) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XAZ4A-0007MZ-G0 for emacs-devel@gnu.org; Fri, 25 Jul 2014 02:33:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XAZ41-00087C-FL for emacs-devel@gnu.org; Fri, 25 Jul 2014 02:33:18 -0400 Original-Received: from mail-we0-x235.google.com ([2a00:1450:400c:c03::235]:64473) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XAZ3r-00086H-Uw; Fri, 25 Jul 2014 02:33:00 -0400 Original-Received: by mail-we0-f181.google.com with SMTP id k48so3798532wev.40 for ; Thu, 24 Jul 2014 23:32:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:to:cc:subject:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=l96NWGo1uGYzvu5UUdaqlx18hlvFamsupClglcNZ2n8=; b=cVLt90emizIwzfQu/iVMLicedLnGGYBfAIKpgiDgIUCrWs1ycl8OfZ3nSwpccISI2P ybpaRM8wMQoQJR7rR9Asi9AazBBWpCGunzLM1bxSL5aVQwrChccAaBte2eKCjeeuM97W kwHtfIQJgYhsG+aJSaDZnnysLNWHMmLZiHUscybtRYYfLcZgFNqvefpPE7XBSqKA429r /9lWD5p4YMjTh4WfSWCLhBQ6Z0ociMrlyX7Zl39RT8mI6nQXnvxaxBXbiVKQOCUrpftK A2MXYM116hHDisG5QZI/Dg+F6xYiQhVEtpUxilfDHn/7gxs7M/DsJyu+15QfFlg6Qt08 u/cw== X-Received: by 10.180.212.12 with SMTP id ng12mr2293775wic.9.1406269978390; Thu, 24 Jul 2014 23:32:58 -0700 (PDT) Original-Received: from Zorglub.gmail.com ([83.145.91.46]) by mx.google.com with ESMTPSA id ch5sm22488833wjb.18.2014.07.24.23.32.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Jul 2014 23:32:57 -0700 (PDT) In-Reply-To: <874my72avb.wl%kwhite@gnu.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.4.50 (x86_64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c03::235 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:173129 Archived-At: At Thu, 24 Jul 2014 08:35:04 -0400, Kelvin White wrote: > > > This change mainly affects users that may connect to the same server > multiple times for multiple networks. e.g. bouncers like ZNC or proxy > users. In these cases a user will have multiple server-buffers with > the same name (i.e. irc.example.net:6697, irc.example.net:6697<2> etc.) > This patch will rename the server-buffer to whatever the network name > is, if available. Otherwise, the hostname:port will be used as normal. > > === modified file 'lisp/erc/erc.el' > --- lisp/erc/erc.el 2014-07-08 19:45:24 +0000 > +++ lisp/erc/erc.el 2014-07-24 12:25:24 +0000 > @@ -6233,7 +6233,9 @@ > (cond ((erc-default-target) > (concat (erc-string-no-properties (erc-default-target)) > "@" network-name)) > - (network-name network-name) > + (network-name > + (rename-buffer network-name) > + network-name) > (t (buffer-name (current-buffer)))))) > I had another problem but quite similar. I'm using znc to connect to several network and sometimes I speak to people with the same nick but on different network so I rewrited the erc-get-buffer-create function. Network name is appended at the end of buffer name. Sorry I have no patch for this, only the code: (defun erc-get-buffer-create (server port target) "Create a new buffer based on the arguments." (setq target (concat target "@" (prin1-to-string (erc-current-network)))) (get-buffer-create (erc-generate-new-buffer-name server port target))) It is not perfect because for server buffers I have "@nil", "@nil<1>", ... but it works great for channels or private messages. -- Cédric Chépied