From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#45872: 27.1; rcirc nick tracking Date: Tue, 27 Jul 2021 08:22:23 +0000 Message-ID: <87wnpcxj28.fsf@posteo.net> References: <87zh1bwbin.fsf@redhat.com> <87im11dzcz.fsf@gnus.org> <87czr99r23.fsf@posteo.net> <87wnpfzroo.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38680"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , 45872@debbugs.gnu.org To: Ken Raeburn Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 27 10:23:10 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m8IMn-0009oC-AD for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 27 Jul 2021 10:23:09 +0200 Original-Received: from localhost ([::1]:34486 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m8IMl-0003og-UD for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 27 Jul 2021 04:23:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40948) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m8IMg-0003oU-DD for bug-gnu-emacs@gnu.org; Tue, 27 Jul 2021 04:23:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40896) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m8IMf-0004Sp-VN for bug-gnu-emacs@gnu.org; Tue, 27 Jul 2021 04:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m8IMf-0008Ao-T3 for bug-gnu-emacs@gnu.org; Tue, 27 Jul 2021 04:23:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Jul 2021 08:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45872 X-GNU-PR-Package: emacs Original-Received: via spool by 45872-submit@debbugs.gnu.org id=B45872.162737415431383 (code B ref 45872); Tue, 27 Jul 2021 08:23:01 +0000 Original-Received: (at 45872) by debbugs.gnu.org; 27 Jul 2021 08:22:34 +0000 Original-Received: from localhost ([127.0.0.1]:52442 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m8IME-0008A7-76 for submit@debbugs.gnu.org; Tue, 27 Jul 2021 04:22:34 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:43151) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m8IMB-00089s-LI for 45872@debbugs.gnu.org; Tue, 27 Jul 2021 04:22:33 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 2105E240104 for <45872@debbugs.gnu.org>; Tue, 27 Jul 2021 10:22:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1627374145; bh=P51+ElxGwGHaJG4rxncfEYd0Oy1z24pGG4JosLIcXPg=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=Rq1odJea56dxOZQ8fiOZS01gq/bmMIYF7aLCa1xR6yxK4CrUO6sPORYgbSMFcQ3st FLsC7DovbuguUMPkfiSQgDhuz7cEMXj7uBpwbEPtrjlxWMZcnUm7Zk+jYsNqDsP1Vt FC6fNee0CbwuBTXQedCUsMlP4W7n/4Y6k+BHdz6SIPjedkdQd2lNUGqCNQDiyfskax 5MRqKMNZvmLn8Ie7AXbWlezHWLZYn55jT1RDoRY9KSzMeHaU1YSJ6uE8DOjgktLb2U +89xspXgYBu/5PytUMAprCt+e5FOidFFme8wVCzPbXIzl7JpVNw+xRWxIUP09kYvKh lj1gZTP/FQmyg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4GYqXc17Jxz9rxX; Tue, 27 Jul 2021 10:22:24 +0200 (CEST) Autocrypt: addr=philipk@posteo.net; prefer-encrypt=mutual; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB In-Reply-To: (Ken Raeburn's message of "Mon, 26 Jul 2021 17:46:58 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:210783 Archived-At: --=-=-= Content-Type: text/plain Ken Raeburn writes: > On 7/24/21 10:56 AM, Philip Kaludercic wrote: > >> Ken Raeburn writes: > >> I forgot to update this ticket... I found that rcirc-buffer-alist >> included a nick that had text properties set, and scanning the list >> didn't find a match. I used advice-add to postprocess the list after >> rcirc-handler-NICK using string-equal to work around it, and that >> seems to do the job (as long as I can stay connected). >> >> I haven't checked in a while to see if it's been fixed. If not, a >> better fix might be stripping out the text properties before putting a >> nick into the list. >> That shouldn't be an issue, but I wonder where the text properties come >> from. Could you find out what text properties these were that were >> confusing rcirc? > > It's setting font-lock-face to rcirc-other-nick. Oh... but I'm mixing > this up with some other issue, I think. My apologies... the text > properties are stored, but they're just a distraction. The access > methods like assoc-string do ignore them. > > Looking back at the 27.1 code I'm still running, I don't think there's > anything even trying to update rcirc-buffer-alist in response to > NICK. Rename the buffer, yes, but not change the key it's listed > under. If a buffer johnsmith@irc.server is initially stored in the > alist under the key "johnsmith" (or #("johnsmith" 0 9 (font-lock-face > (rcirc-other-nick)))) then it'll still be stored under that key even > if the buffer is renamed to johnsmith|away@irc.server. That is true, the following should fix that: --=-=-= Content-Type: text/plain Content-Disposition: inline diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 60751c14e2..e5663d3fe6 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -3149,7 +3149,11 @@ rcirc-handler-NICK (with-current-buffer chat-buffer (rcirc-print process sender "NICK" old-nick new-nick) (setq rcirc-target new-nick) - (rename-buffer (rcirc-generate-new-buffer-name process new-nick))))) + (rename-buffer (rcirc-generate-new-buffer-name process new-nick)))) + (setf rcirc-buffer-alist + (cons (cons new-nick chat-buffer) + (delq (assoc-string old-nick rcirc-buffer-alist t) + rcirc-buffer-alist)))) ;; remove old nick and add new one (with-rcirc-process-buffer process (let ((v (gethash old-nick rcirc-nick-table))) --=-=-= Content-Type: text/plain Since the handler hasn't been changed since 2005, you should be able to apply the change and see if it works. > So one failure to rename the buffer is those cases where the key in > rcirc-buffer-alist doesn't match, because a previous rename didn't > update the key, and the handle hasn't been renamed back to its > original value as stored in as a key in the alist. > > If the buffer rename back to remove the "|away" is missed, then I > can't use the johnsmith|away@irc.server buffer to talk to > johnsmith@irc.server any more, as I described in my original > report. The handle info stored in the buffer is out of date. I can use > "/msg johnsmith" and it'll create a new johnsmith@irc.server buffer, > but another NICK message might try to rename that to > johnsmith|away@irc.server again and would fail. > > Ken > -- Philip Kaludercic --=-=-=--