Subject: 23.1; erc reconnection should reuse existing buffers

From: Tom Tromey <[email-masked]>
Date: Thu, 11 Feb 2010 10:00:31 -0700

Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the [email-masked] mailing list,
and to the gnu.emacs.bug news group.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

I connect to multiple irc servers with erc.
There are a couple of channels that have the same name on different
servers; e.g. I have two different channels named #gdb.

erc puts these into buffers named #gdb and #gdb<2>.
Ok so far.

Now, on occasion I will lose connection to the servers.  erc will
reconnect.  In this case, usually the buffer #gdb will be properly
reused by the reconnection.  However, #gdb<2> will be discarded and erc
will make a new buffer named #gdb<3>.

I wish it always reused the existing buffer instead.

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
/usr/share/emacs/23.1/etc/DEBUG for instructions.

In GNU Emacs 23.1.1 (i386-redhat-linux-gnu, GTK+ Version 2.16.6)
 of 2010-01-14 on x86-01.phx2.fedoraproject.org
Windowing system distributor `The X.Org Foundation', version 11.0.10603901
configured using `configure  '--build=i386-redhat-linux-gnu' '--host=i386-redhat-linux-gnu' '--target=i586-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-dbus' '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff' '--with-xft' '--with-xpm' '--with-x-toolkit=gtk' 'build_alias=i386-redhat-linux-gnu' 'host_alias=i386-redhat-linux-gnu' 'target_alias=i586-redhat-linux-gnu' 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i586 -mtune=generic -fasynchronous-unwind-tables''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Group

Minor modes in effect:
  shell-dirtrack-mode: t
  diff-auto-refine-mode: t
  gnus-undo-mode: t
  erc-list-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-match-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-netsplit-mode: t
  erc-spelling-mode: t
  erc-truncate-mode: t
  erc-status-mode: t
  erc-services-mode: t
  erc-networks-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
SPC m y SPC o t h e r SPC b u g , SPC I ' l l SPC d 
o SPC t h a t SPC n o w <return> C-z o M-v M-v C-r 
e r c C-a = <switch-frame> <switch-frame> C-s = > C-s 
C-s C-a Q y SPC SPC n <switch-frame> <switch-frame> 
c SPC s M-x r e p o r t - e m <tab> b <tab> C-g <switch-frame> 
f l e <tab> C-a C-k C-x b i r <tab> f r <tab> <return> 
/ h e l p SPC / q u i t M-b <backspace> <return> / 
h e l p SPC d i s c o n n e c t <return> M-p M-p <return> 
C-x 1 C-c b f l <tab> I SPC c a n ' t SPC t e s t SPC 
i t SPC r i g h t SPC n o w SPC b u t SPC i f SPC / 
q u i t SPC w o r k s SPC w h i l e SPC r <backspace> 
e r c SPC <M-backspace> <M-backspace> i n SPC M-b M-b 
M-b M-b C-k b a s i c a l l y SPC I SPC w a n t SPC 
/ q u i t SPC t o SPC w o r k SPC i n t SPC h e SPC 
s i t u a t i o n SPC M-b M-b C-b C-t C-e w h e r e 
SPC C-a C-k <f10> <f10> <f10> <f10> M-v M-> C-z o M-x 
r e p o r t - e m a c s - b u g <return> <return> C-x 
1 C-x k <return> y e s <return> M-x p <return> M-p 
<return>

Recent messages:
Saving /home/tromey/.newsrc.eld...
Saving file /home/tromey/.newsrc.eld...
Wrote /home/tromey/.newsrc.eld
Saving /home/tromey/.newsrc.eld...done
Quit
Type C-x 1 to delete the help window.
Type C-x 4 C-o RET to restore the other window.  
Type C-x 4 C-o RET to restore the other window.
Mark set
Making completion list...

Tom