unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#12002: 24.1.50; ERC nick change trouble
@ 2012-07-20 22:56 Antoine Levitt
  2012-10-07  1:29 ` Glenn Morris
  0 siblings, 1 reply; 2+ messages in thread
From: Antoine Levitt @ 2012-07-20 22:56 UTC (permalink / raw)
  To: 12002

Hi,

There's a bug in ERC nick change handling. Imagine you have a query with
john, who has a timeout. He then comes back as john-, and queries
you. Then, when his old timeout goes away, he changes nick back to
john. The ERC response handler then tries to change the john- query
buffer name to john, which clashes with the old buffer. Since there was
an error in the execution flow, everything is messed up.

Here's a patch that doesn't try to change the name back when a buffer of
the same name exists. It still notifies the old query buffer of the name
change though. I haven't tested it but it should be fine. (I think ...)

I'm not holding my breath on this, because of the lack of activity of
ERC maintainers. Still, at least the patch is out there.

diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index cce24e6..115c31f 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -1313,10 +1313,11 @@ add things to `%s' instead."
       (erc-buffer-filter
        (lambda ()
          (when (equal (erc-default-target) nick)
-           (setq erc-default-recipients
-                 (cons nn (cdr erc-default-recipients)))
-           (rename-buffer nn)
-           (erc-update-mode-line)
+           (unless (get-buffer nn)
+             (setq erc-default-recipients
+                   (cons nn (cdr erc-default-recipients)))
+             (rename-buffer nn)
+             (erc-update-mode-line))
            (add-to-list 'bufs (current-buffer)))))
       (erc-update-user-nick nick nn host nil nil login)
       (cond





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#12002: 24.1.50; ERC nick change trouble
  2012-07-20 22:56 bug#12002: 24.1.50; ERC nick change trouble Antoine Levitt
@ 2012-10-07  1:29 ` Glenn Morris
  0 siblings, 0 replies; 2+ messages in thread
From: Glenn Morris @ 2012-10-07  1:29 UTC (permalink / raw)
  To: 12002-done

Version: 24.3

Thanks. I installed a simpler change (below). Please let me know if it
is not ok, since I don't use erc.

*** lisp/erc/erc-backend.el	2012-10-06 01:04:53 +0000
--- lisp/erc/erc-backend.el	2012-10-07 01:25:39 +0000
***************
*** 1316,1322 ****
           (when (equal (erc-default-target) nick)
             (setq erc-default-recipients
                   (cons nn (cdr erc-default-recipients)))
!            (rename-buffer nn)
             (erc-update-mode-line)
             (add-to-list 'bufs (current-buffer)))))
        (erc-update-user-nick nick nn host nil nil login)
--- 1316,1322 ----
           (when (equal (erc-default-target) nick)
             (setq erc-default-recipients
                   (cons nn (cdr erc-default-recipients)))
!            (rename-buffer nn t)         ; bug#12002
             (erc-update-mode-line)
             (add-to-list 'bufs (current-buffer)))))
        (erc-update-user-nick nick nn host nil nil login)






^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-10-07  1:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-20 22:56 bug#12002: 24.1.50; ERC nick change trouble Antoine Levitt
2012-10-07  1:29 ` Glenn Morris

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).