From unknown Sat Jul 26 10:00:37 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52010: 28.0.50; ERC now ignores dialed server names in autojoin Resent-From: "J.P." Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Nov 2021 00:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 52010 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 52010@debbugs.gnu.org Cc: emacs-erc@gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.163745373929044 (code B ref -1); Sun, 21 Nov 2021 00:16:02 +0000 Received: (at submit) by debbugs.gnu.org; 21 Nov 2021 00:15:39 +0000 Received: from localhost ([127.0.0.1]:43849 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moaWA-0007YN-PP for submit@debbugs.gnu.org; Sat, 20 Nov 2021 19:15:39 -0500 Received: from lists.gnu.org ([209.51.188.17]:57466) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moaW8-0007YD-VW for submit@debbugs.gnu.org; Sat, 20 Nov 2021 19:15:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39172) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1moaW8-0002HZ-L8 for bug-gnu-emacs@gnu.org; Sat, 20 Nov 2021 19:15:36 -0500 Received: from mail-108-mta112.mxroute.com ([136.175.108.112]:43215) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1moaW6-00085t-6O for bug-gnu-emacs@gnu.org; Sat, 20 Nov 2021 19:15:36 -0500 Received: from filter004.mxroute.com ([149.28.56.236] filter004.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta112.mxroute.com (ZoneMTA) with ESMTPSA id 17d3fd9081e000177f.001 for (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Sun, 21 Nov 2021 00:15:27 +0000 X-Zone-Loop: 375a455da9a66bca565fc29c7fb75b07f860f57ed8b4 X-Originating-IP: [149.28.56.236] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=neverwas.me ; s=x; h=Content-Type:MIME-Version:Message-ID:Date:Subject:Cc:To:From:Sender: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=NGN3gKpxkvP2cv1YElIFfBLwTQ01Pu3MNgNlTuKGRwc=; b=f TklwgfN80dISrOMWuWdPv+N60y8RU9BpJfguqm1gLzzA0xf2rEbaIC8Dm3zyBveov0L/szkD6emw+ QiDuPwf8ABIC1ItydZeL412l2clQLvShThUQuh2lAI9WdpRUz8MaSBdBBPXYVWfC4JbfKIurXQ8iU 7v2fxQ2lwq745MablslyKN6yFZIuym+msFBGVlSzT5cyIqKL3niNQo1qwG/1GY2wa/6lHs1iujkjP gDGNELweWN8EIvOToJMIl7IkCVNGuJbqvYVtAuWpCTbnq/m4BKXPghbkogyEocgEmxfgs221MP/iB zVoN2BaPHGvETjC9Eb+qmK+8m8fUAUhuQ==; From: "J.P." Date: Sat, 20 Nov 2021 16:15:24 -0800 Message-ID: <87ilwmbbz7.fsf@neverwas.me> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-AuthUser: masked@neverwas.me X-Zone-Spam-Resolution: no action X-Zone-Spam-Status: No, score=-0.1, required=15, tests=[ARC_NA=0, RCPT_COUNT_TWO=0, FROM_HAS_DN=0, HAS_ATTACHMENT=0, FROM_EQ_ENVFROM=0, MIME_TRACE=0, MIME_GOOD=-0.1, TO_DN_NONE=0, MID_RHS_MATCH_FROM=0, RCVD_COUNT_ZERO=0, NEURAL_SPAM=0] Received-SPF: pass client-ip=136.175.108.112; envelope-from=jp@neverwas.me; helo=mail-108-mta112.mxroute.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain Tags: patch A recent addition [1] to ERC (and now Emacs 28) introduced a breaking change that's set to create some churn for (what I suspect will be) a noticeable swath of ERC users. First off, this is solely my fault because I advocated for this addition without envisioning, much less trying to forestall, the coming disruption [2]. What this boils down to is that folks with an entry like ("irc.libera.chat" "#libera") in their `erc-autojoin-channels-alist' will find that it no longer works because ERC now matches against what's called the "announced" name (e.g., "foo.libera.chat") rather than the "dialed" name ("irc.libera.chat" or "localhost" or "my.vps.net") [3]. Anyway, apologies for the delay in bringing this to the tracker [4]. The attached patch attempts to right the offending portions while preserving the benefits introduced by [1], which I still believe to be significant. Please direct your daggers toward me and not [1]'s author. Thanks. P.S. Tests for this reside in #48598. Notes ~~~~~ [1] commit 9bb8d90cddf11df3aecdc6c04e762773dfa0cb92 Allow irc network symbols in erc-autojoin-channels-alist [2] I suppose I've been so preoccupied with whining about the underlying problem this exposes (mostly in my progress reports for #48598) that I neglected to confront the reality of [1] becoming the last word on join-related business for a good while. IOW, having #48598's patch set build on [1]'s changes while believing wholeheartedly that both would make it into 28 was classic hubris on my part in that it drove me to "forget" to consider what would happen if the two ever found themselves on opposite sides of a release divide. Which they have. [3] In reality, "announced" is favored only when set, which is basically always because the 004 handler runs right on the heels of connection registration. For anyone who cares, kensanata added the fallback in 2005, right around when `erc-announced-server-name' became `erc-server-announced-name'. BTW, this new reorienting toward the "announced" name isn't actually the focus of [1], which is more about elevating network names to equal footing. And it isn't really "new" at all but more like a restoration of what's historically been the preferred (and, from 2001 to 2005, only) means of referring to an IRC session. Only in the last few years or so has ERC actually been conflicted in this regard. [4] For a couple weeks now, I've been trying to reach out to the person who initially brought this to our attention on Libera, but that's become a lost cause. I mainly wanted to confirm that their suspicions of this being an Emacs-29-only thing were in fact wrong, which I'm now certain of. In GNU Emacs 29.0.50 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.24.30, cairo version 1.17.4) of 2021-11-18 built on localhost Repository revision: 69f1bc43c026049ed2aab6a6368e2e9a5406b779 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: Fedora 34 (Workstation Edition) Configured using: 'configure --enable-check-lisp-object-type --enable-checking=yes,glyphs --build=x86_64-redhat-linux-gnu --host=x86_64-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/lib64 --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=gtk3 --with-gpm=no --with-xwidgets --with-modules --with-harfbuzz --with-cairo --with-json build_alias=x86_64-redhat-linux-gnu host_alias=x86_64-redhat-linux-gnu CC=gcc 'CFLAGS=-O0 -g3' LDFLAGS=-Wl,-z,relro PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XPM XWIDGETS GTK3 ZLIB Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media rmc puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json map text-property-search time-date seq gv subr-x byte-opt bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils help-mode cl-loaddefs cl-lib iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads xwidget-internal dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 53474 6237) (symbols 48 6794 1) (strings 32 19269 1625) (string-bytes 1 642335) (vectors 16 14025) (vector-slots 8 189932 12509) (floats 8 22 37) (intervals 56 262 0) (buffers 992 10)) --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-Fall-back-on-dialed-server-names-in-erc-join.patch >From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Wed, 10 Nov 2021 23:42:42 -0800 Subject: [PATCH 02/29] Fall back on dialed server names in erc-join * lisp/erc/erc-join.el (erc-autojoin-server-match, erc-autojoin-current-server): as a fallback, always try the original server param passed to `erc-open' when matching against members of `erc-autojoin-channels-alist'. Similarly, when adding and removing items, only apply the `erc-autojoin-domain-only' truncation treatment to "announced" servers. --- lisp/erc/erc-join.el | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/lisp/erc/erc-join.el b/lisp/erc/erc-join.el index 2ed8622b85..1a6bdedc98 100644 --- a/lisp/erc/erc-join.el +++ b/lisp/erc/erc-join.el @@ -103,7 +103,11 @@ erc-autojoin-domain-only If non-nil, and a channel on the server a.b.c is joined, then only b.c is used as the server for `erc-autojoin-channels-alist'. This is important for networks that redirect you to other -servers, presumably in the same domain." +servers, presumably in the same domain. + +This treatment will only be applied to so-called \"announced names\", +like zirconium.libera.chat, but not to \"dialed\" hostnames, like +my.proxy.localdomain or my.vps.example.com." :type 'boolean) (defvar-local erc--autojoin-timer nil) @@ -127,9 +131,9 @@ erc-autojoin-server-match This should be a key from `erc-autojoin-channels-alist'." (or (eq candidate (erc-network)) (and (stringp candidate) - (string-match-p candidate - (or erc-server-announced-name - erc-session-server))))) + (or (and erc-server-announced-name ; unnecessary after #48598 + (string-match-p candidate erc-server-announced-name)) + (string-match-p candidate erc-session-server))))) (defun erc-autojoin-after-ident (_network _nick) "Autojoin channels in `erc-autojoin-channels-alist'. @@ -184,11 +188,12 @@ erc-autojoin-channels (defun erc-autojoin-current-server () "Compute the current server for lookup in `erc-autojoin-channels-alist'. Respects `erc-autojoin-domain-only'." - (let ((server (or erc-server-announced-name erc-session-server))) - (if (and erc-autojoin-domain-only - (string-match "[^.\n]+\\.\\([^.\n]+\\.[^.\n]+\\)$" server)) - (match-string 1 server) - server))) + (if (and erc-autojoin-domain-only + erc-server-announced-name + (string-match "[^.\n]+\\.\\([^.\n]+\\.[^.\n]+\\)$" + erc-server-announced-name)) + (match-string 1 erc-server-announced-name) + erc-session-server)) (defun erc-autojoin-add (proc parsed) "Add the channel being joined to `erc-autojoin-channels-alist'." -- 2.31.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 20 20:32:48 2021 Received: (at control) by debbugs.gnu.org; 21 Nov 2021 01:32:48 +0000 Received: from localhost ([127.0.0.1]:43868 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mobip-0001JV-UI for submit@debbugs.gnu.org; Sat, 20 Nov 2021 20:32:48 -0500 Received: from mail-108-mta116.mxroute.com ([136.175.108.116]:35385) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mobim-0001JE-3s for control@debbugs.gnu.org; Sat, 20 Nov 2021 20:32:46 -0500 Received: from filter004.mxroute.com ([149.28.56.236] filter004.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta116.mxroute.com (ZoneMTA) with ESMTPSA id 17d401f9bea000177f.001 for (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Sun, 21 Nov 2021 01:32:33 +0000 X-Zone-Loop: 89e658399a651996ecf5d77b72b7723067992f1573d0 X-Originating-IP: [149.28.56.236] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=neverwas.me ; s=x; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From:Sender: Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=yH0i10YdpoRN3FmmZnzbf1vsKrgZRvTISnhd9yr2JIs=; b=nRD/LK3i4ov+r5QX1YVGHB5fLW c0QKEVRI2PzkL5Tn8YvooWxICLqSGYnoEEi+sP2cj0M3umyMtLuUNlBuR1TPMPfkbcG1VP/LfBXd1 6fnK7GVKVnXxzu0nlJtIArCOO48SCGciKJcXZE/Zf7AmKXj1mvjqnCqYb3RFj+qm7vdSXOx6DI4jy S5b3EONrRGrmvwAdoWKB/bXSvtY32CduEZY7czER+1iITq/RksM+hdcEZ5SqCoVPNYuYKNzctaPN0 vkIkHxO0YGBR+3eEzgADOJY4ahO/JxMSqEOlazMwjBXweitHkJaodFQ4PMPSfMNoUUcq3tf5rKz4S j4aMNdXg==; From: "J.P." To: control@debbugs.gnu.org Subject: control message for bug #52010 Date: Sat, 20 Nov 2021 17:32:30 -0800 Message-ID: <87ee7ab8ep.fsf@neverwas.me> MIME-Version: 1.0 Content-Type: text/plain X-AuthUser: masked@neverwas.me X-Zone-Spam-Resolution: no action X-Zone-Spam-Status: No, score=-0.1, required=15, tests=[ARC_NA=0, NEURAL_SPAM=0, FROM_HAS_DN=0, MIME_GOOD=-0.1, FROM_EQ_ENVFROM=0, MIME_TRACE=0, RCVD_COUNT_ZERO=0, RCPT_COUNT_ONE=0, MID_RHS_MATCH_FROM=0, TO_DN_NONE=0] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) retitle 52010 28.0.60; ERC now ignores dialed server names in autojoin quit Sorry, wrong version in the report body's gathered facts as well. But the commit in question exists in both refs/heads/emacs-28 and master. From unknown Sat Jul 26 10:00:37 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52010: 28.0.60; ERC now ignores dialed server names in autojoin Resent-From: "J.P." Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Nov 2021 11:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52010 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 52010@debbugs.gnu.org Cc: emacs-erc@gnu.org Received: via spool by 52010-submit@debbugs.gnu.org id=B52010.163749427717301 (code B ref 52010); Sun, 21 Nov 2021 11:32:02 +0000 Received: (at 52010) by debbugs.gnu.org; 21 Nov 2021 11:31:17 +0000 Received: from localhost ([127.0.0.1]:44332 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mol41-0004Uy-9W for submit@debbugs.gnu.org; Sun, 21 Nov 2021 06:31:17 -0500 Received: from mail-108-mta174.mxroute.com ([136.175.108.174]:44487) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mol3y-0004Uj-FS for 52010@debbugs.gnu.org; Sun, 21 Nov 2021 06:31:15 -0500 Received: from filter004.mxroute.com ([149.28.56.236] filter004.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta174.mxroute.com (ZoneMTA) with ESMTPSA id 17d42439d19000177f.001 for <52010@debbugs.gnu.org> (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Sun, 21 Nov 2021 11:31:07 +0000 X-Zone-Loop: 011d7d843c5add341725cb7f12456c0a92ad6c2f454e X-Originating-IP: [149.28.56.236] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=neverwas.me ; s=x; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References: Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=XJMszF1gGloYNM4nmvTE4+aHH0jdFHWXTGsu2MNLenk=; b=mn7ihnY+D8Oo7EtZQ0HTRYPvFA ZiKygrUhmJcEWZN7NIeHdicBIhtvrcTG5esusHcyh6ccFgXU2Ih7s9Kg2P24B6MM6b215/NV1w+CO ARq5y/W68d3DzPTX3K2xoVtoN6HDntoyvg4jjNjwsDoTpRk3xectOcbInd5Nq6HT27Pvik3RNjRxl 06j7yHlxFBqa/G5JDr/vqaCcA40xvHqTGebcbarzrzYroQRb2ma4QlgA59nYzAg3+2gD4gEsPJ5mD vy9aKA6nM7x45MLuVLxPzANRqGOUKc7MVXLOH/oTON1X5CYYw2xaswwCAJLTlsEmkPhpjoyk+RYgy 07fUjfhQ==; From: "J.P." References: <87ilwmbbz7.fsf@neverwas.me> Date: Sun, 21 Nov 2021 03:31:03 -0800 In-Reply-To: <87ilwmbbz7.fsf@neverwas.me> (J. P.'s message of "Sat, 20 Nov 2021 16:15:24 -0800") Message-ID: <87bl2d7nk8.fsf@neverwas.me> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-AuthUser: masked@neverwas.me X-Zone-Spam-Resolution: no action X-Zone-Spam-Status: No, score=-0.1, required=15, tests=[ARC_NA=0, RCPT_COUNT_TWO=0, FROM_HAS_DN=0, HAS_ATTACHMENT=0, FROM_EQ_ENVFROM=0, MIME_TRACE=0, MIME_GOOD=-0.1, TO_DN_NONE=0, MID_RHS_MATCH_FROM=0, RCVD_COUNT_ZERO=0, NEURAL_SPAM=0] X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain v2: a small tweak to leave a tidier footprint for git-blame. Also, some slight corrections on the timeline: Jan 20, 2003 - Register autojoin function with `erc-after-connect' hook, which passes in `erc-announced-server-name' for function's server param Jun 26, 2005 - Add dialed server as fallback when announced name missing Sep 16, 2005 - Deprecate `erc-announced-server-name' in favor of `erc-server-announced-name' Jan 05, 2017 - Switch from announced to dialed, ignoring server param provided by `erc-after-connect' hook Sep 16, 2021 - Switch from dialed to announced, but consider networks This patch - Stay the course, but always fall back to dialed (not just when unset) Bug #48598 - Prefer unique session identifiers based around and compatible with networks, but fall back on announced, then dialed (for compatibility) --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0000-v1-v2.diff >From e804e5c160b8ee1fa1ad2e1af7bcf3dd694cd14b Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Sat, 20 Nov 2021 23:53:49 -0800 Subject: NOT A PATCH F. Jason Park (1): Fall back on dialed server names in erc-join lisp/erc/erc-join.el | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) Interdiff: diff --git a/lisp/erc/erc-join.el b/lisp/erc/erc-join.el index 1a6bdedc98..887c40a00c 100644 --- a/lisp/erc/erc-join.el +++ b/lisp/erc/erc-join.el @@ -105,9 +105,9 @@ erc-autojoin-domain-only This is important for networks that redirect you to other servers, presumably in the same domain. -This treatment will only be applied to so-called \"announced names\", -like zirconium.libera.chat, but not to \"dialed\" hostnames, like -my.proxy.localdomain or my.vps.example.com." +This treatment will only be applied to so-called \"announced\" names, +like zirconium.libera.chat, but not to \"dialed\" names, like +209.51.188.117 or my.vps.example.net." :type 'boolean) (defvar-local erc--autojoin-timer nil) @@ -131,7 +131,7 @@ erc-autojoin-server-match This should be a key from `erc-autojoin-channels-alist'." (or (eq candidate (erc-network)) (and (stringp candidate) - (or (and erc-server-announced-name ; unnecessary after #48598 + (or (and erc-server-announced-name (string-match-p candidate erc-server-announced-name)) (string-match-p candidate erc-session-server))))) @@ -188,12 +188,12 @@ erc-autojoin-channels (defun erc-autojoin-current-server () "Compute the current server for lookup in `erc-autojoin-channels-alist'. Respects `erc-autojoin-domain-only'." - (if (and erc-autojoin-domain-only - erc-server-announced-name - (string-match "[^.\n]+\\.\\([^.\n]+\\.[^.\n]+\\)$" - erc-server-announced-name)) - (match-string 1 erc-server-announced-name) - erc-session-server)) + (let ((server erc-server-announced-name)) + (if (and erc-autojoin-domain-only + server + (string-match "[^.\n]+\\.\\([^.\n]+\\.[^.\n]+\\)$" server)) + (match-string 1 server) + erc-session-server))) (defun erc-autojoin-add (proc parsed) "Add the channel being joined to `erc-autojoin-channels-alist'." -- 2.31.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fall-back-on-dialed-server-names-in-erc-join.patch >From e804e5c160b8ee1fa1ad2e1af7bcf3dd694cd14b Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Wed, 10 Nov 2021 23:42:42 -0800 Subject: [PATCH 1/1] Fall back on dialed server names in erc-join * lisp/erc/erc-join.el (erc-autojoin-server-match, erc-autojoin-current-server): as a fallback, always try the original server argument passed to `erc-open' when matching against members of `erc-autojoin-channels-alist'. Similarly, when adding and removing items, only apply the `erc-autojoin-domain-only' truncation treatment to "announced" servers. --- lisp/erc/erc-join.el | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lisp/erc/erc-join.el b/lisp/erc/erc-join.el index 2ed8622b85..887c40a00c 100644 --- a/lisp/erc/erc-join.el +++ b/lisp/erc/erc-join.el @@ -103,7 +103,11 @@ erc-autojoin-domain-only If non-nil, and a channel on the server a.b.c is joined, then only b.c is used as the server for `erc-autojoin-channels-alist'. This is important for networks that redirect you to other -servers, presumably in the same domain." +servers, presumably in the same domain. + +This treatment will only be applied to so-called \"announced\" names, +like zirconium.libera.chat, but not to \"dialed\" names, like +209.51.188.117 or my.vps.example.net." :type 'boolean) (defvar-local erc--autojoin-timer nil) @@ -127,9 +131,9 @@ erc-autojoin-server-match This should be a key from `erc-autojoin-channels-alist'." (or (eq candidate (erc-network)) (and (stringp candidate) - (string-match-p candidate - (or erc-server-announced-name - erc-session-server))))) + (or (and erc-server-announced-name + (string-match-p candidate erc-server-announced-name)) + (string-match-p candidate erc-session-server))))) (defun erc-autojoin-after-ident (_network _nick) "Autojoin channels in `erc-autojoin-channels-alist'. @@ -184,11 +188,12 @@ erc-autojoin-channels (defun erc-autojoin-current-server () "Compute the current server for lookup in `erc-autojoin-channels-alist'. Respects `erc-autojoin-domain-only'." - (let ((server (or erc-server-announced-name erc-session-server))) + (let ((server erc-server-announced-name)) (if (and erc-autojoin-domain-only + server (string-match "[^.\n]+\\.\\([^.\n]+\\.[^.\n]+\\)$" server)) (match-string 1 server) - server))) + erc-session-server))) (defun erc-autojoin-add (proc parsed) "Add the channel being joined to `erc-autojoin-channels-alist'." -- 2.31.1 --=-=-=-- From unknown Sat Jul 26 10:00:37 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52010: 28.0.60; ERC now ignores dialed server names in autojoin Resent-From: "J.P." Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Nov 2021 01:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52010 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 52010@debbugs.gnu.org Cc: emacs-erc@gnu.org Received: via spool by 52010-submit@debbugs.gnu.org id=B52010.163754542021876 (code B ref 52010); Mon, 22 Nov 2021 01:44:01 +0000 Received: (at 52010) by debbugs.gnu.org; 22 Nov 2021 01:43:40 +0000 Received: from localhost ([127.0.0.1]:46400 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moyMt-0005gl-Q1 for submit@debbugs.gnu.org; Sun, 21 Nov 2021 20:43:40 -0500 Received: from mail-108-mta113.mxroute.com ([136.175.108.113]:35821) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moyMr-0005gN-Ln for 52010@debbugs.gnu.org; Sun, 21 Nov 2021 20:43:38 -0500 Received: from filter004.mxroute.com ([149.28.56.236] filter004.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta113.mxroute.com (ZoneMTA) with ESMTPSA id 17d454fedd5000177f.001 for <52010@debbugs.gnu.org> (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Mon, 22 Nov 2021 01:43:25 +0000 X-Zone-Loop: 023a9991cb70985cf53610371aa7ee46fc20c0fae9bf X-Originating-IP: [149.28.56.236] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=neverwas.me ; s=x; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References: Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=n1xqLavKE21xeKMwae/AVoHCGznTAqyy/t56rlI9U4I=; b=e023+DkBvpxdQ2Ov1yG1coksID 9JYjR3vL7IUOkO7mpZ3jd6II3QhQEAGnqUkdEmEMxgqdN8NS08WZScK+uFCJK45uDaLSlDHOiNqRo wk8W0L6c2QeYFQjh8nOasFuBJ56Jc5HKsmbHuaPQYGkI9Mif8Y2Ppno4kV6o/7KL0WcgCBeiKmHYV M4Ngi3Ljvo92JDlGQyQgJ8c2ZOccXzNGtPLur1kqex6N+y4Q0j/DZEilGGl+3qNxu3y65wG+J1Z0u GaTAY7WgvNww01FmTTK95suXqcye3Hwi9ohNzUNaRuwHji3a/4dRGGM4cvVXR6ZcJSzqPlvLmI3TK xqSa7l0g==; From: "J.P." References: <87ilwmbbz7.fsf@neverwas.me> Date: Sun, 21 Nov 2021 17:43:23 -0800 In-Reply-To: <87ilwmbbz7.fsf@neverwas.me> (J. P.'s message of "Sat, 20 Nov 2021 16:15:24 -0800") Message-ID: <875ysl3qys.fsf@neverwas.me> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AuthUser: masked@neverwas.me X-Zone-Spam-Resolution: no action X-Zone-Spam-Status: No, score=-0.1, required=15, tests=[ARC_NA=0, FROM_HAS_DN=0, MIME_GOOD=-0.1, TO_DN_NONE=0, NEURAL_SPAM=0, RCPT_COUNT_TWO=0, RCVD_COUNT_ZERO=0, FROM_EQ_ENVFROM=0, MIME_TRACE=0, MID_RHS_MATCH_FROM=0] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Actually, please ignore everything stated previously (and the patch as well). The 2017 change [1] was *not* the source of the problem as wrongly implied in my previous email (although it did get the ball rolling by changing from announced to dialed names for auth-source queries). The real culprit is actually something way more recent [2]: diff --git a/lisp/erc/erc-join.el b/lisp/erc/erc-join.el index e4faf6bd79..79c111082f 100644 --- a/lisp/erc/erc-join.el +++ b/lisp/erc/erc-join.el @@ -153,18 +153,20 @@ erc-autojoin-channels 'erc-autojoin-channels-delayed server nick (current-buffer)))) ;; `erc-autojoin-timing' is `connect': - (dolist (l erc-autojoin-channels-alist) - (when (string-match (car l) server) - (let ((server (or erc-session-server erc-server-announced-name))) + (let ((server (or erc-session-server erc-server-announced-name))) + (dolist (l erc-autojoin-channels-alist) + (when (string-match-p (car l) server) But its damage has already been undone by [3] (IOW, there's no regression)! So everything's fine as long as we don't mind a bit of churn for folks on master who may have adjusted their autojoin alists in the meantime (since August 2020 or so). I suppose if we *really* wanted to be thorough, we could add an entry to etc/ERC-NEWS saying a problem introduced in early in Emacs-28 development has been fixed and that any entries in `erc-autojoin-channels-alist' containing dialed host names as keys should use networks or partial announced domains instead. But, IMO, that's unnecessary. Thanks, and apologies (yet again) for the noise. [1] commit 927dcbd2e6e0e53fcfb09296716e11c002ab1518 Fix erc-join with channel password [2] commit 88567ca8ecb505a59157af6338ebe355a304182b Fix erc-reuse-buffers behavior [3] commit 9bb8d90cddf11df3aecdc6c04e762773dfa0cb92 Allow irc network symbols in erc-autojoin-channels-alist From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 21 20:45:35 2021 Received: (at control) by debbugs.gnu.org; 22 Nov 2021 01:45:35 +0000 Received: from localhost ([127.0.0.1]:46404 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moyOi-0005kM-8l for submit@debbugs.gnu.org; Sun, 21 Nov 2021 20:45:35 -0500 Received: from mail-108-mta85.mxroute.com ([136.175.108.85]:40971) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moyOd-0005k2-Om for control@debbugs.gnu.org; Sun, 21 Nov 2021 20:45:31 -0500 Received: from filter004.mxroute.com ([149.28.56.236] filter004.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta85.mxroute.com (ZoneMTA) with ESMTPSA id 17d455197ed000177f.001 for (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Mon, 22 Nov 2021 01:45:14 +0000 X-Zone-Loop: 2fac4ff6b5b982b712ef3c7dd091dedafd5f1629fec5 X-Originating-IP: [149.28.56.236] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=neverwas.me ; s=x; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From:Sender: Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=M4kNuVcq48g7k4plArXQM1qRUYPNMbs4eSCKI/WR6qA=; b=EW79/89NhQ20t3cbMbdFZeof6g 2dvSm+v604CUMH3v1VMRSdijbNe3megXaJ9I7hutm3YQrOis6s9NbfketAOv/mOYoeYfTG446XSTi nEPC3tx6aooSIT0nPnk0SPysiyzi7vfVLPwL9jZCxjN7Iz9DfP9VpYmezvfUACu6PfTMFr3p9BiZL Of1GqKYmTMCYukp1RmOSU6aKjnt7WD2NDbifwvfawBXgPLSqKGEscIXIzG3KR30Cr+9vcRKMuv7Tz OKhefhreDX+A8kbh0CCF08MNQpB73HfwJLypScd5LHsyy0+LuFKEFi9EjjUTgfGwFB3r1ujsRgPgA TN/eSicw==; From: "J.P." To: control@debbugs.gnu.org Subject: control message for bug #52010 Date: Sun, 21 Nov 2021 17:45:12 -0800 Message-ID: <8735np3qvr.fsf@neverwas.me> MIME-Version: 1.0 Content-Type: text/plain X-AuthUser: masked@neverwas.me X-Zone-Spam-Resolution: no action X-Zone-Spam-Status: No, score=-0.1, required=15, tests=[ARC_NA=0, NEURAL_SPAM=0, FROM_HAS_DN=0, MIME_GOOD=-0.1, FROM_EQ_ENVFROM=0, MIME_TRACE=0, RCVD_COUNT_ZERO=0, RCPT_COUNT_ONE=0, MID_RHS_MATCH_FROM=0, TO_DN_NONE=0] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) close 52010 28.1 quit