GNU bug report logs - #50009
28.0.50; add CRLF to outgoing ERC protocol logger lines

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: "J.P." <jp@HIDDEN>; Keywords: patch; Done: Lars Ingebrigtsen <larsi@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug marked as fixed in version 28.1, send any further explanations to 50009 <at> debbugs.gnu.org and "J.P." <jp@HIDDEN> Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 50009 <at> debbugs.gnu.org:


Received: (at 50009) by debbugs.gnu.org; 16 Sep 2021 13:36:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 16 09:36:42 2021
Received: from localhost ([127.0.0.1]:54143 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mQrZ7-00029f-Gy
	for submit <at> debbugs.gnu.org; Thu, 16 Sep 2021 09:36:42 -0400
Received: from quimby.gnus.org ([95.216.78.240]:36548)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mQrZ3-00029K-QH
 for 50009 <at> debbugs.gnu.org; Thu, 16 Sep 2021 09:36:36 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; 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=dYz9FQ1txgBzDjBc45FRwV5yiX2ELmvwNGx3jXqBqF0=; b=T55UfHQGFwst1EQmk+kfvwnnvm
 pKYqQcEYsOqjyPNmnZ6+SkqMnE0H8WDsO2fPZ6yBYVa3xe9yzt/aLMEKsv+VnSWhnBX2qle05XY+b
 Aqw6504hWgnG5Y1eul01nMeyE2g05Xk6rE3L+obXLzloNO4hpbFFpmbTDU2fx93pl0L8=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mQrYu-0004mG-Rf; Thu, 16 Sep 2021 15:36:27 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: "J.P." <jp@HIDDEN>
Subject: Re: bug#50009: 28.0.50; add CRLF to outgoing ERC protocol logger lines
References: <87v94chxbh.fsf@HIDDEN> <87czpb4ilx.fsf@HIDDEN>
Date: Thu, 16 Sep 2021 15:36:24 +0200
In-Reply-To: <87czpb4ilx.fsf@HIDDEN> (J. P.'s message of "Tue, 14 Sep
 2021 02:22:18 -0700")
Message-ID: <87r1do1w2v.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  "J.P." <jp@HIDDEN> writes: > v5. Having two styles of
 line terminator (both CRLF and LF) present in > the same buffer was dumb.
 So now it's just CRLF everywhere. I've also > explained a bit about the format
 in the doc string fo [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50009
Cc: 50009 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

"J.P." <jp@HIDDEN> writes:

> v5. Having two styles of line terminator (both CRLF and LF) present in
> the same buffer was dumb. So now it's just CRLF everywhere. I've also
> explained a bit about the format in the doc string for the version
> number variable. Thanks.

Thanks; makes sense to me (and seems to work well when testing it), so
I've pushed it to Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50009; Package emacs. Full text available.

Message received at 50009 <at> debbugs.gnu.org:


Received: (at 50009) by debbugs.gnu.org; 16 Sep 2021 05:42:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 16 01:42:47 2021
Received: from localhost ([127.0.0.1]:53607 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mQkAZ-0006Ou-Au
	for submit <at> debbugs.gnu.org; Thu, 16 Sep 2021 01:42:47 -0400
Received: from eggs.gnu.org ([209.51.188.92]:59376)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mQkAW-0006Oh-8i
 for 50009 <at> debbugs.gnu.org; Thu, 16 Sep 2021 01:42:45 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:40240)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mQkAQ-00036T-Ki; Thu, 16 Sep 2021 01:42:38 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4885
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mQkAQ-0007Hr-6u; Thu, 16 Sep 2021 01:42:38 -0400
Date: Thu, 16 Sep 2021 08:42:35 +0300
Message-Id: <83ilz19ius.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Amin Bandali <bandali@HIDDEN>
In-Reply-To: <87bl4ts7xv.fsf@HIDDEN> (message from Amin Bandali on Wed, 15
 Sep 2021 20:03:24 -0400)
Subject: Re: bug#50009: 28.0.50; add CRLF to outgoing ERC protocol logger lines
References: <87v94chxbh.fsf@HIDDEN> <87czpb4ilx.fsf@HIDDEN>
 <87v9335te6.fsf@dick> <87lf3y7pic.fsf@HIDDEN> <87lf3xpzkb.fsf@dick>
 <87bl4ts7xv.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50009
Cc: 50009 <at> debbugs.gnu.org, dick.r.chiang@HIDDEN, jp@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Amin Bandali <bandali@HIDDEN>
> Date: Wed, 15 Sep 2021 20:03:24 -0400
> Cc: 50009 <at> debbugs.gnu.org, "J.P." <jp@HIDDEN>
> 
> dick writes:
> 
> > Sigh, it pains me to have to add to the verbiage maelstrom that is debbugs
> > when the antiquity of GNU patch is self-evident.
> 
> To be clear, GNU is by far not the only project that uses patch-driven
> workflows.

This discussion doesn't belong here.  Here we discus a specific issue
submitted to the Emacs issue tracker.  Broad discussions about our
development workflows should be held on emacs-devel.  Please move it
there (if you must have this discussion, which is about the umpteenth
time it is being brought up, including very recently).

Whatever you do, please STOP discussing it here.  Right now, the only
effect this has is to make following the discussions of bug#50009 much
harder by polluting it with unrelated messages, which are not even
tangents.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50009; Package emacs. Full text available.

Message received at 50009 <at> debbugs.gnu.org:


Received: (at 50009) by debbugs.gnu.org; 16 Sep 2021 00:20:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 15 20:20:33 2021
Received: from localhost ([127.0.0.1]:53476 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mQf8j-0006uL-Ej
	for submit <at> debbugs.gnu.org; Wed, 15 Sep 2021 20:20:33 -0400
Received: from mail-qv1-f50.google.com ([209.85.219.50]:44994)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dick.r.chiang@HIDDEN>) id 1mQf8e-0006u5-J7
 for 50009 <at> debbugs.gnu.org; Wed, 15 Sep 2021 20:20:31 -0400
Received: by mail-qv1-f50.google.com with SMTP id 62so3093001qvb.11
 for <50009 <at> debbugs.gnu.org>; Wed, 15 Sep 2021 17:20:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=frONbR+PJppsvkKzytEsQXf01w2JOuoxght7cDm1CpU=;
 b=be2E/xgWSkFuBNLHcVBHXfg/BTuyhEiejs0MCEBySxEyRRY0CFRS72z89FGtYxqEEr
 pvzI7AxD3CDlFGUWMM2tCfpvddPhHUGMY/b1FkgOaN4ZXfZWfRBSCpgMFec4OtGSQ/7W
 PAH5a8Spe+ls1DTmiEWkLYv/xfVfWAxCuekxV8xWbbX5PEZcppzHwVb2GMTq+jWgv5PT
 QCEgTsGMWjcnIBlDeMKTt4lX1zdH0RARb5z4YVItdkke1OZK7q1PTAsUlcS6o+OC8bm0
 3wIMo/nn6x3zCnmgxd6A+VUTXygX9IPw76tBxxGPQQVpJ41YDIR75EeJb04diqFetCdC
 34UQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=frONbR+PJppsvkKzytEsQXf01w2JOuoxght7cDm1CpU=;
 b=bx06bgUO5T1hS1J/z50O4oPoZrU8tyAlyUtGSO6BL8pfz163DVvZsL9zpPvpao6AoB
 RisLZx1pLGZa4B1D9mXYF0y5lsvam+1pYVl5CgA6EPi08eEksLxK2giMHDt9haM+xJfh
 dXBb019mhfQdI6HTRHIO3rkQRMsBRIBLGTHxwIAadu85Qtojg33rzpiyRillZWGZB3qo
 6qoBZG0JDa0oECWbQ+eoKAGFToaw5Tm4fXAhG0sBsSnX9R7mHQR6jYBpS1E6MryUqQuM
 Ho2RTlC7slzN/NBDBVLXNXAvtjDbwF50VqBcdDNxeWQxqhejej1oxf4OohWr0yvmBcxd
 YsZg==
X-Gm-Message-State: AOAM530t+rVwnCrXuIu5ul5pNL8upIvtk6mh6Br85IoSNu2ijRQRXVf1
 2lbYVzvNUJyi2o3nMNm4HLBorvycPjM=
X-Google-Smtp-Source: ABdhPJx3aD4hreNnnPyakiCE85mWVwey2rI24FzT1AETj/XQ1PphspWjIO+zxfKN/ExX2QnzLNCYnA==
X-Received: by 2002:ad4:5583:: with SMTP id e3mr2816045qvx.42.1631751622930;
 Wed, 15 Sep 2021 17:20:22 -0700 (PDT)
Received: from localhost ([68.237.93.126])
 by smtp.gmail.com with ESMTPSA id u13sm1006336qtg.29.2021.09.15.17.20.22
 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256);
 Wed, 15 Sep 2021 17:20:22 -0700 (PDT)
From: dick <dick.r.chiang@HIDDEN>
To: Amin Bandali <bandali@HIDDEN>
Subject: Re: bug#50009: 28.0.50; add CRLF to outgoing ERC protocol logger lines
References: <87v94chxbh.fsf@HIDDEN> <87czpb4ilx.fsf@HIDDEN>
 <87v9335te6.fsf@dick> <87lf3y7pic.fsf@HIDDEN> <87lf3xpzkb.fsf@dick>
 <87bl4ts7xv.fsf@HIDDEN>
Date: Wed, 15 Sep 2021 20:20:22 -0400
In-Reply-To: <87bl4ts7xv.fsf@HIDDEN> (Amin Bandali's message of "Wed, 15 Sep
 2021 20:03:24 -0400")
Message-ID: <87wnnhnzg9.fsf@dick>
User-Agent: Gnus/5.14 (Gnus v5.14) Commercial/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50009
Cc: 50009 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> I've seen my fair share of similarly long yet considerably worse GitHub
> discussions

"Considerably worse" would be an understatement.  Verbosity is a function of
the age and number of participants, and Github skews unfavorably in both those
categories.

My point was the verbosity, a systemic cost to doing business, does not
under a PR-based workflow occlude the proposed changeset, whereas under
"wonderful" Debbugs the proliferation of proposed patches could.

Your raising the example of native-comp merely reinforces my point that
branch-based schemes are superior to ad hoc email-based ones.

It's clear we've already made our minds about it.  But you asked, so I
answered.  Pardon the "interference" to those trying to "do their job."




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50009; Package emacs. Full text available.

Message received at 50009 <at> debbugs.gnu.org:


Received: (at 50009) by debbugs.gnu.org; 16 Sep 2021 00:03:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 15 20:03:36 2021
Received: from localhost ([127.0.0.1]:53455 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mQesK-0006VE-2o
	for submit <at> debbugs.gnu.org; Wed, 15 Sep 2021 20:03:36 -0400
Received: from eggs.gnu.org ([209.51.188.92]:46268)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bandali@HIDDEN>) id 1mQesG-0006V0-PR
 for 50009 <at> debbugs.gnu.org; Wed, 15 Sep 2021 20:03:35 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:60216)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <bandali@HIDDEN>)
 id 1mQesA-0004WQ-LZ; Wed, 15 Sep 2021 20:03:26 -0400
Received: from [2607:fea8:3fdf:f2d9:a862:b3ff:bd8c:7958] (port=42928
 helo=langa)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <bandali@HIDDEN>)
 id 1mQesA-0002qd-G1; Wed, 15 Sep 2021 20:03:26 -0400
From: Amin Bandali <bandali@HIDDEN>
To: dick <dick.r.chiang@HIDDEN>
Subject: Re: bug#50009: 28.0.50; add CRLF to outgoing ERC protocol logger lines
References: <87v94chxbh.fsf@HIDDEN> <87czpb4ilx.fsf@HIDDEN>
 <87v9335te6.fsf@dick> <87lf3y7pic.fsf@HIDDEN> <87lf3xpzkb.fsf@dick>
Date: Wed, 15 Sep 2021 20:03:24 -0400
In-Reply-To: <87lf3xpzkb.fsf@dick>
Message-ID: <87bl4ts7xv.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50009
Cc: 50009 <at> debbugs.gnu.org, "J.P." <jp@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

dick writes:

> Sigh, it pains me to have to add to the verbiage maelstrom that is debbugs
> when the antiquity of GNU patch is self-evident.

To be clear, GNU is by far not the only project that uses patch-driven
workflows.

> A maintainer's sanity is inversely related to how much reading he has to do.
> In a PR-based workflow, the changeset is unambiguous.  On a platform like
> Github, the changeset is manifest (in pretty colors) from the "Files Changed"
> tab in a PR submission.  Eleventh-hour revisions get incorporated without fuss
> via the mild genius of git.

I don't see how a GitHub-like interface which separates code from
surrounding context/discussion is any more helpful.  PR comments are
also meant to be read and responded to -- much like email threads --
only they're more poorly implemented and often require a full blown
web browser to interact with.

I get the 'pretty colors' and syntax highlighting in my MUA (email
client), which happens to be Emacs-based, just fine.  For Emacs,
there's even a wonderful 'debbugs' package on GNU ELPA that I highly
encourage folks to try, if they use the debbugs bug tracker regularly.

> Here, OP has submitted several changesets, of which only the chronologically
> latest he wishes the maintainer to consider.  To ascertain this fact, the
> maintainer must read, and recall his happiness is inversely proportional to
> how much reading he has to do.

I mean, using a decent MUA one could easily skip or move back and
forth between various replies in a thread, and fairly quickly tell
which attached patch needs review/merging, like Eli alluded to.

> In a cluster**** like bug#45474 where literally every one and their third
> cousin is espousing a changeset, the maintainer not only has to read, he has
> to decide, and that is a whole other circle of hell.  The programmer's
> tendency to pontificate and obfuscate (of which the present missive is a fine
> example) does not help matters.

I'm not sure what to say to this, other than 1. those sound to me
like rather unkind characterizations of the people involved in that
discussion and their work, and 2. I've seen my fair share of similarly
long yet considerably worse GitHub discussions/comments.  As far as
I could tell from a quick glance, people in bug#45474 seem to be
discussing/collaborating in good faith, and amicably.  Yet I wouldn't
attribute that to the underlying piece of software (Debbugs) or
workflow (patch-based) being used.

To wrap up this wall of text and move on, I get that different people
have different preferences of workflow, but I don't see how the things
you said describe any inherent advantage/"superior"ity of the PR-based
workflow.  If your point is about pushing code to some branch for
review and subsequent updates being more convenient, people already do
that for larger changes to Emacs (e.g. native-comp) by developing
their work in an auxiliary 'feature/...' branch in emacs.git, which is
then reviewed and hopefully merged into the main development branch at
some point.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50009; Package emacs. Full text available.

Message received at 50009 <at> debbugs.gnu.org:


Received: (at 50009) by debbugs.gnu.org; 15 Sep 2021 18:13:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 15 14:13:31 2021
Received: from localhost ([127.0.0.1]:53196 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mQZPX-00065T-Ju
	for submit <at> debbugs.gnu.org; Wed, 15 Sep 2021 14:13:31 -0400
Received: from eggs.gnu.org ([209.51.188.92]:40246)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mQZPT-00065C-5Q
 for 50009 <at> debbugs.gnu.org; Wed, 15 Sep 2021 14:13:30 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:46832)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mQZPN-0005VW-A9; Wed, 15 Sep 2021 14:13:21 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2603
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mQZPL-00059s-5L; Wed, 15 Sep 2021 14:13:19 -0400
Date: Wed, 15 Sep 2021 21:13:17 +0300
Message-Id: <835yv1btc2.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: dick <dick.r.chiang@HIDDEN>
In-Reply-To: <87h7elpw3p.fsf@dick> (message from dick on Wed, 15 Sep 2021
 13:49:46 -0400)
Subject: Re: bug#50009: 28.0.50; add CRLF to outgoing ERC protocol logger lines
References: <87v94chxbh.fsf@HIDDEN> <87czpb4ilx.fsf@HIDDEN>
 <87v9335te6.fsf@dick> <87lf3y7pic.fsf@HIDDEN> <87lf3xpzkb.fsf@dick>
 <838rzxbvzs.fsf@HIDDEN> <87h7elpw3p.fsf@dick>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50009
Cc: 50009 <at> debbugs.gnu.org, bandali@HIDDEN, jp@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: dick <dick.r.chiang@HIDDEN>
> Cc: 50009 <at> debbugs.gnu.org,  bandali@HIDDEN,  jp@HIDDEN
> Date: Wed, 15 Sep 2021 13:49:46 -0400
> 
> EZ> You are not helping, so please at least don't interfere.
> 
> Your hamfisted use of the terms "helping" and "interfere" presuppose a notion
> of progress, one which is premised on the status quo.

No, I mean helping and interfering with us, the maintainers, doing our
job.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50009; Package emacs. Full text available.

Message received at 50009 <at> debbugs.gnu.org:


Received: (at 50009) by debbugs.gnu.org; 15 Sep 2021 17:49:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 15 13:49:55 2021
Received: from localhost ([127.0.0.1]:53182 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mQZ2g-0005NN-VJ
	for submit <at> debbugs.gnu.org; Wed, 15 Sep 2021 13:49:55 -0400
Received: from mail-qt1-f180.google.com ([209.85.160.180]:37522)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dick.r.chiang@HIDDEN>) id 1mQZ2f-0005NA-Dy
 for 50009 <at> debbugs.gnu.org; Wed, 15 Sep 2021 13:49:54 -0400
Received: by mail-qt1-f180.google.com with SMTP id m9so3100051qtk.4
 for <50009 <at> debbugs.gnu.org>; Wed, 15 Sep 2021 10:49:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=UlP5xzO0N82K5CRghnhIkIaRwYF54lPIt9wp7UlGzAM=;
 b=pHnRDz4mLIUbesbCw/ohM8kolv0aKt/bx0uFwXcbhmAGT12pxhpbTmlpnIligkYA8j
 W2nbiK57lrtiEoW6ZokhLXAv2qhUOeO6DxJMRrUBhw/UayJChpM+gosH+tYuOI0PVysz
 ZaNFwT6KkKnfRRiNJGExcGpPdiUqaDKP5cn9dXZ7sjyNepIKg+M+3bFJpNRYRi76Wvv2
 SrgQ+VN6suYt60Pj0/c5OSeB81fjrAcCFTCiWopwmhaoksUJhqDVR7voIypimxeHImQ+
 JscOJND0GyuWsbvmh2QpK2CvQvwb7xY1U/tLQJyyVLm7QqEfyYWt1R9+EAkigcDj7Cd7
 iV2Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=UlP5xzO0N82K5CRghnhIkIaRwYF54lPIt9wp7UlGzAM=;
 b=GvWvL2Yn0FtT5XFzuMt6rqQm8vpN6C66v2PIiiJvyJs0K2eSlJa+l/SKljL7VZtB6j
 w/vJcIoIoX0BDzmSkclS6/tLTshqTd+necI8TFXlb9ddUDpC7odVihPtSHbnlX9Rnw9T
 3t/d7sVgvYlr3KOfHAS9cWoJiRVIyiV8N317mmCVoAjmg77qk6r9NgO5Vf7YKdpkzqnU
 hARYAxyMifAAi8+5rmfHBqvrZ+71tqDAMGQlL54hxNMJMEuJbTIZOWpomhl7vZTuU4GM
 9XT1zdARbx8FXCCKaH0dS9AAyc1+5XVqAYOWoE7TlkvptdpybvwdpxsemwLXuxofqFKi
 QnRQ==
X-Gm-Message-State: AOAM531+Dw9Sod9iPS+6BWRGIOzL5ipffIdnPH2Itd5tmvTc4/u7HpeW
 02jUWikSMg0DoFxufuaftGk=
X-Google-Smtp-Source: ABdhPJz38gQuCOkV9386XIiUI5nro6jq1teAuaW+b9KbGx0w7GDeeSkbnUmBYFNGZZy6RqcktXVmiQ==
X-Received: by 2002:ac8:5753:: with SMTP id 19mr1120515qtx.202.1631728187939; 
 Wed, 15 Sep 2021 10:49:47 -0700 (PDT)
Received: from localhost ([68.237.93.126])
 by smtp.gmail.com with ESMTPSA id w11sm523447qkp.49.2021.09.15.10.49.47
 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256);
 Wed, 15 Sep 2021 10:49:47 -0700 (PDT)
From: dick <dick.r.chiang@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#50009: 28.0.50; add CRLF to outgoing ERC protocol logger lines
References: <87v94chxbh.fsf@HIDDEN> <87czpb4ilx.fsf@HIDDEN>
 <87v9335te6.fsf@dick> <87lf3y7pic.fsf@HIDDEN> <87lf3xpzkb.fsf@dick>
 <838rzxbvzs.fsf@HIDDEN>
Date: Wed, 15 Sep 2021 13:49:46 -0400
In-Reply-To: <838rzxbvzs.fsf@HIDDEN> (Eli Zaretskii's message of "Wed, 15 Sep
 2021 20:15:51 +0300")
Message-ID: <87h7elpw3p.fsf@dick>
User-Agent: Gnus/5.14 (Gnus v5.14) Commercial/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 50009
Cc: 50009 <at> debbugs.gnu.org, bandali@HIDDEN, jp@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

EZ> You are not helping, so please at least don't interfere.

Your hamfisted use of the terms "helping" and "interfere" presuppose a notion
of progress, one which is premised on the status quo.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50009; Package emacs. Full text available.

Message received at 50009 <at> debbugs.gnu.org:


Received: (at 50009) by debbugs.gnu.org; 15 Sep 2021 17:16:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 15 13:16:07 2021
Received: from localhost ([127.0.0.1]:53152 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mQYVy-0004Rq-GS
	for submit <at> debbugs.gnu.org; Wed, 15 Sep 2021 13:16:07 -0400
Received: from eggs.gnu.org ([209.51.188.92]:54244)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mQYVt-0004R1-P5
 for 50009 <at> debbugs.gnu.org; Wed, 15 Sep 2021 13:16:05 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:44720)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mQYVo-0000ET-3k; Wed, 15 Sep 2021 13:15:56 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3043
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mQYVn-0007yn-Fu; Wed, 15 Sep 2021 13:15:56 -0400
Date: Wed, 15 Sep 2021 20:15:51 +0300
Message-Id: <838rzxbvzs.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: dick <dick.r.chiang@HIDDEN>
In-Reply-To: <87lf3xpzkb.fsf@dick> (message from dick on Wed, 15 Sep 2021
 12:35:00 -0400)
Subject: Re: bug#50009: 28.0.50; add CRLF to outgoing ERC protocol logger lines
References: <87v94chxbh.fsf@HIDDEN> <87czpb4ilx.fsf@HIDDEN>
 <87v9335te6.fsf@dick> <87lf3y7pic.fsf@HIDDEN> <87lf3xpzkb.fsf@dick>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50009
Cc: 50009 <at> debbugs.gnu.org, bandali@HIDDEN, jp@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: dick <dick.r.chiang@HIDDEN>
> Date: Wed, 15 Sep 2021 12:35:00 -0400
> Cc: 50009 <at> debbugs.gnu.org, "J.P." <jp@HIDDEN>
> 
> Sigh, it pains me to have to add to the verbiage maelstrom that is debbugs
> when the antiquity of GNU patch is self-evident.

You are not helping, so please at least don't interfere.

There's no problem knowing which patch is the latest one, contrary to
your propaganda.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50009; Package emacs. Full text available.

Message received at 50009 <at> debbugs.gnu.org:


Received: (at 50009) by debbugs.gnu.org; 15 Sep 2021 16:35:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 15 12:35:10 2021
Received: from localhost ([127.0.0.1]:53101 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mQXsM-0003LB-DT
	for submit <at> debbugs.gnu.org; Wed, 15 Sep 2021 12:35:10 -0400
Received: from mail-qk1-f176.google.com ([209.85.222.176]:43796)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dick.r.chiang@HIDDEN>) id 1mQXsJ-0003KY-6z
 for 50009 <at> debbugs.gnu.org; Wed, 15 Sep 2021 12:35:08 -0400
Received: by mail-qk1-f176.google.com with SMTP id ay33so4047492qkb.10
 for <50009 <at> debbugs.gnu.org>; Wed, 15 Sep 2021 09:35:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=7c2/HxxHFiENoqKTwy4i+vu3SK8i522uokhNg7nBakA=;
 b=mo4lp1tl1HK6CPc7w96ct4tOpouFjSdBl/1+kxeQarbMRsUD6FAAmjjQKXoAIT12I+
 sci8PRdG9CbaDAj2CoXqv2OW1lNQb7mS60SUwBW1cWRP9rC6VFSlQraFtdfi7FecOUcc
 ltQPeAxvrMILwjdbtPeUvnQU14h1O8R5yyUKHdvtAOXGgGigiAXAH91BR8JQpxP8C8hs
 zPpXx4dPa0tk0PY1QiBzuJEv18c2MxGkrEx6VERw4TchDPDKsr2pgNqAbGEtQvg5HAFl
 P3GeLOUScUAQaC7MJ1P5v+0IWBGPD0aV10CrS+aAxwk3azZik3w43lGCScMF4nEH92nt
 Cz2w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=7c2/HxxHFiENoqKTwy4i+vu3SK8i522uokhNg7nBakA=;
 b=lXXJzO5JbOmDNPVTFDbEU+x/NGShyoxhYS92dWzQ10YGW8k4UORtSQi8Bnz8xJUcaL
 SGIXdw5RJUX3tof8w0PmNLpY5iBCv5vFYCWR6IBe598iVHMjlLHcPNg3yZRHa7HTmafI
 8HtVB8b1sB9E2MBEwgCiyXIvsZ0Jbn+o6tkXm2eP1oKJ/6gTWytucP1dS1ceB8J/h0j/
 24DtV2sh832JYabrAaeumVnAgWESv5zTauxq3R4xJA+VQaMjcDV9nOB2oQsVttZ/6iax
 EJ5S4YCk7k0YWrxjzFIjVSwDOuXyHJiMBoZcQBonoxPulWJHClnkJbyuzwvSOyfYUvBi
 UfIA==
X-Gm-Message-State: AOAM532pbhc/EBiWS6ZshJUeEAHqDR3vBFgSvjCFM7QlsDWryvUiDIUL
 Hsr37M9fwQppGaQ2PijZSg4=
X-Google-Smtp-Source: ABdhPJwYO+AKTwm3LSbV/dl+139Y3ZiJ/UhvB6nf5jM2YaqIs++/t73bR+4Ji/Noh6p2k5eRBoT2aw==
X-Received: by 2002:a05:620a:1aa5:: with SMTP id
 bl37mr827532qkb.84.1631723701692; 
 Wed, 15 Sep 2021 09:35:01 -0700 (PDT)
Received: from localhost ([68.237.93.126])
 by smtp.gmail.com with ESMTPSA id x125sm366009qkd.8.2021.09.15.09.35.01
 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256);
 Wed, 15 Sep 2021 09:35:01 -0700 (PDT)
From: dick <dick.r.chiang@HIDDEN>
To: Amin Bandali <bandali@HIDDEN>
Subject: Re: bug#50009: 28.0.50; add CRLF to outgoing ERC protocol logger lines
References: <87v94chxbh.fsf@HIDDEN> <87czpb4ilx.fsf@HIDDEN>
 <87v9335te6.fsf@dick> <87lf3y7pic.fsf@HIDDEN>
Date: Wed, 15 Sep 2021 12:35:00 -0400
In-Reply-To: <87lf3y7pic.fsf@HIDDEN> (Amin Bandali's message of "Tue, 14 Sep
 2021 18:37:15 -0400")
Message-ID: <87lf3xpzkb.fsf@dick>
User-Agent: Gnus/5.14 (Gnus v5.14) Commercial/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50009
Cc: 50009 <at> debbugs.gnu.org, "J.P." <jp@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Sigh, it pains me to have to add to the verbiage maelstrom that is debbugs
when the antiquity of GNU patch is self-evident.

A maintainer's sanity is inversely related to how much reading he has to do.
In a PR-based workflow, the changeset is unambiguous.  On a platform like
Github, the changeset is manifest (in pretty colors) from the "Files Changed"
tab in a PR submission.  Eleventh-hour revisions get incorporated without fuss
via the mild genius of git.

Here, OP has submitted several changesets, of which only the chronologically
latest he wishes the maintainer to consider.  To ascertain this fact, the
maintainer must read, and recall his happiness is inversely proportional to
how much reading he has to do.

In a cluster**** like bug#45474 where literally every one and their third
cousin is espousing a changeset, the maintainer not only has to read, he has
to decide, and that is a whole other circle of hell.  The programmer's
tendency to pontificate and obfuscate (of which the present missive is a fine
example) does not help matters.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50009; Package emacs. Full text available.

Message received at 50009 <at> debbugs.gnu.org:


Received: (at 50009) by debbugs.gnu.org; 14 Sep 2021 22:37:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 14 18:37:41 2021
Received: from localhost ([127.0.0.1]:50365 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mQH3d-0004sg-Ao
	for submit <at> debbugs.gnu.org; Tue, 14 Sep 2021 18:37:41 -0400
Received: from eggs.gnu.org ([209.51.188.92]:56536)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bandali@HIDDEN>) id 1mQH3b-0004sR-Tr
 for 50009 <at> debbugs.gnu.org; Tue, 14 Sep 2021 18:37:40 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:42140)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <bandali@HIDDEN>)
 id 1mQH3V-0001bF-MZ; Tue, 14 Sep 2021 18:37:33 -0400
Received: from [2607:fea8:3fdf:f2d9:10b6:3211:b381:151e] (port=52356
 helo=langa)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <bandali@HIDDEN>)
 id 1mQH3U-0005h1-9K; Tue, 14 Sep 2021 18:37:33 -0400
From: Amin Bandali <bandali@HIDDEN>
To: dick <dick.r.chiang@HIDDEN>
Subject: Re: bug#50009: 28.0.50; add CRLF to outgoing ERC protocol logger lines
References: <87v94chxbh.fsf@HIDDEN> <87czpb4ilx.fsf@HIDDEN>
 <87v9335te6.fsf@dick>
Date: Tue, 14 Sep 2021 18:37:15 -0400
In-Reply-To: <87v9335te6.fsf@dick>
Message-ID: <87lf3y7pic.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50009
Cc: 50009 <at> debbugs.gnu.org, "J.P." <jp@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

dick writes:

> I think we can all agree this kind of "come to think of it" iteration is why
> PR-based submission is superior to patches.

Do we?  What's superior about it?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50009; Package emacs. Full text available.

Message received at 50009 <at> debbugs.gnu.org:


Received: (at 50009) by debbugs.gnu.org; 14 Sep 2021 10:44:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 14 06:44:10 2021
Received: from localhost ([127.0.0.1]:47652 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mQ5v8-00052g-Fq
	for submit <at> debbugs.gnu.org; Tue, 14 Sep 2021 06:44:10 -0400
Received: from mail-qk1-f176.google.com ([209.85.222.176]:44835)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dick.r.chiang@HIDDEN>) id 1mQ5v6-00052T-Qk
 for 50009 <at> debbugs.gnu.org; Tue, 14 Sep 2021 06:44:09 -0400
Received: by mail-qk1-f176.google.com with SMTP id c10so14173148qko.11
 for <50009 <at> debbugs.gnu.org>; Tue, 14 Sep 2021 03:44:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=aWnmoAMVb9CHm0ZaB8MbfIFUDZU3YVJ+OxSfWB0PXuc=;
 b=qUuEFOnaXhPLUkOi5gTr7o+5cvVi13Bw2072xtGvMr7QiJFRa64MN+Hewf/XoEZJLf
 HuOvYa1b6wTzRmd3jt0q8Wi5Nc7Z26EzFvgTJyS8GLRJ56tmZQpIiP/hOj0whqoh1OG6
 mhleJBqW5/dV5UgqwVqBMdnvv6uPebUEaQSlCsnbddIbxz8GmPQA+F5wPnqJnFTArZD6
 c/UfQ1sPHdB593ehefkgGP0GlgZMaIPgamwdLKHdmB5okoydOQa4qIwX+ALT4R+vWAtB
 UBUpeMQlp9Zzv7IGH5G42dpSXo776PVh+FGN4Eb1U12ZSJwo/KVlLpnmJGFAoHahLGGP
 1cFA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=aWnmoAMVb9CHm0ZaB8MbfIFUDZU3YVJ+OxSfWB0PXuc=;
 b=1gaCm489I4DqiNDuyePJxJfy3eBg7AHRhHLg4IaVIJzEw3gtbiE8ldWU+jf2TnUJ8K
 WJ3UNa9vOM9kQGEeR0vuz/7X2w9i71B5+qtZWU97hlLLS+3MySZE+jPgRPJvpgmPfj8n
 19j8ymjORPK6mshyuW3n7ose09qt6Bxt6KNKXc6IfG3R/3rXkq6lThUkHZ7nwKuckQ6Y
 2nZ7iNeW4Njb8LVlaOmoasTEoudttu6yjhj5RXqcDoXe1SXVazCQo21E152ddlNuMJUH
 SHI+fb4VU5nixpCLuDxF0OQMzj8W3QQOnH5NPdJWR3Qt5QWpmWreBtSkHAUESy1eVPLq
 0giA==
X-Gm-Message-State: AOAM533ZOGpb+OGP6Tp4D9mwFp271Gzn7sSrKHxq1S9GCtw4D5BhyBqz
 i9qLJudf54TRukDSJcY1Bps=
X-Google-Smtp-Source: ABdhPJxG6gjIfu8LHQqzvnBuEo9ceE86N4Ew/1fnrDyejyI+F43+FodxGSQvdco3Ml3GwhIWpec0bw==
X-Received: by 2002:a37:6253:: with SMTP id w80mr4269722qkb.237.1631616243147; 
 Tue, 14 Sep 2021 03:44:03 -0700 (PDT)
Received: from localhost ([68.237.93.126])
 by smtp.gmail.com with ESMTPSA id p12sm5535183qtw.54.2021.09.14.03.44.02
 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256);
 Tue, 14 Sep 2021 03:44:02 -0700 (PDT)
From: dick <dick.r.chiang@HIDDEN>
To: "J.P." <jp@HIDDEN>
Subject: Re: bug#50009: 28.0.50; add CRLF to outgoing ERC protocol logger lines
References: <87v94chxbh.fsf@HIDDEN> <87czpb4ilx.fsf@HIDDEN>
Date: Tue, 14 Sep 2021 06:44:01 -0400
In-Reply-To: <87czpb4ilx.fsf@HIDDEN> (J. P.'s message of "Tue, 14 Sep
 2021 02:22:18 -0700")
Message-ID: <87v9335te6.fsf@dick>
User-Agent: Gnus/5.14 (Gnus v5.14pre) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50009
Cc: 50009 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

I think we can all agree this kind of "come to think of it" iteration is why
PR-based submission is superior to patches.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50009; Package emacs. Full text available.

Message received at 50009 <at> debbugs.gnu.org:


Received: (at 50009) by debbugs.gnu.org; 14 Sep 2021 09:22:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 14 05:22:31 2021
Received: from localhost ([127.0.0.1]:47544 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mQ4e6-0006zw-JX
	for submit <at> debbugs.gnu.org; Tue, 14 Sep 2021 05:22:31 -0400
Received: from mail-108-mta212.mxroute.com ([136.175.108.212]:45259)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jp@HIDDEN>) id 1mQ4e4-0006zi-7m
 for 50009 <at> debbugs.gnu.org; Tue, 14 Sep 2021 05:22:29 -0400
Received: from filter004.mxroute.com ([149.28.56.236] filter004.mxroute.com)
 (Authenticated sender: mN4UYu2MZsgR)
 by mail-108-mta212.mxroute.com (ZoneMTA) with ESMTPSA id
 17be39d486300074ba.001 for <50009 <at> debbugs.gnu.org>
 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256);
 Tue, 14 Sep 2021 09:22:20 +0000
X-Zone-Loop: 7a80f403e7af696f679c0105e9cb2812d90bba87afcf
X-Originating-IP: [149.28.56.236]
From: "J.P." <jp@HIDDEN>
To: 50009 <at> debbugs.gnu.org
Subject: Re: bug#50009: 28.0.50; add CRLF to outgoing ERC protocol logger lines
References: <87v94chxbh.fsf@HIDDEN>
Date: Tue, 14 Sep 2021 02:22:18 -0700
In-Reply-To: <87v94chxbh.fsf@HIDDEN> (J. P.'s message of "Wed, 11 Aug
 2021 07:26:26 -0700")
Message-ID: <87czpb4ilx.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-AuthUser: masked@HIDDEN
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50009
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

v5. Having two styles of line terminator (both CRLF and LF) present in
the same buffer was dumb. So now it's just CRLF everywhere. I've also
explained a bit about the format in the doc string for the version
number variable. Thanks.

.
--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=0000-v4-v5.diff

From 2dcb68486a49d59376778aea97a23ada1af5c1f4 Mon Sep 17 00:00:00 2001
From: "F. Jason Park" <jp@HIDDEN>
Date: Tue, 14 Sep 2021 01:43:43 -0700
Subject: NOT A PATCH

F. Jason Park (1):
  Add CRLF to outgoing ERC protocol logger lines

 lisp/erc/erc.el            | 79 +++++++++++++++++++++++++-------------
 test/lisp/erc/erc-tests.el | 36 +++++++++++++++++
 2 files changed, 88 insertions(+), 27 deletions(-)

Interdiff:
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 524a22e5a1..fe4ec52880 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -2317,7 +2317,16 @@ erc-debug-irc-protocol-time-format
 
 (defconst erc-debug-irc-protocol-version "1"
   "Protocol log format version number.
-This is to help tooling track changes to the format.")
+This exists to help tooling track changes to the format.
+
+In version 1, everything before and including the first double CRLF is
+front matter, which must also be CRLF terminated.  Lines beginning with
+three asterisks must be ignored as comments.  Other lines should be
+interpreted as email-style headers.  Folding is not supported.  A second
+double CRLF, if present, signals the end of a log.  Session resumption
+is not supported.  Logger lines must adhere to the following format:
+TIMESTAMP PEER-NAME FLOW-INDICATOR IRC-MESSAGE CRLF.  Outgoing messages
+are indicated with a >> and incoming with a <<.")
 
 (defvar erc-debug-irc-protocol nil
   "If non-nil, log all IRC protocol traffic to the buffer \"*erc-protocol*\".
@@ -2344,11 +2353,7 @@ erc-log-irc-protocol
 appears in face `erc-input-face' in the buffer.  Lines must already
 contain CRLF endings.  Peer is identified by the most precise label
 available at run time, starting with the network name, followed by the
-self-reported host name, and falling back to the dialed <server>:<port>.
-When capturing logs for multiple peers and sorting them into buckets,
-such inconsistent labeling may pose a problem during an initial server
-burst.  For now, the recommended approach is to wrap this function with
-advice that temporarily redefines the symbol-function `erc-network'."
+announced host name, and falling back to the dialed <server>:<port>."
   (when erc-debug-irc-protocol
     (let ((esid (or (and (fboundp 'erc-network)
                          (erc-network)
@@ -2382,23 +2387,22 @@ erc-log-irc-protocol
 (defun erc-toggle-debug-irc-protocol (&optional arg)
   "Toggle the value of `erc-debug-irc-protocol'.
 
-If ARG is non-nil, show the *erc-protocol* buffer.  Everything before
-and including the first double CRLF is front matter.  Everything before
-the first double linefeed is a header."
+If ARG is non-nil, show the *erc-protocol* buffer."
   (interactive "P")
   (let* ((buf (get-buffer-create "*erc-protocol*")))
     (with-current-buffer buf
       (view-mode-enter)
       (when (null (current-local-map))
         (let ((inhibit-read-only t)
-              (headers (concat "Version: " erc-debug-irc-protocol-version "\n"
-                               "Emacs-Version: " emacs-version "\n"
-                               "\n"))
-              (msg (concat "This buffer displays all IRC protocol traffic "
-                           "exchanged with servers.\n"
-                           "Kill it to disable logging.\n"
-                           "Press `t' to toggle.\n")))
-          (insert headers (erc-make-notice msg)))
+              (msg (list
+                    (concat "Version: " erc-debug-irc-protocol-version)
+                    (concat "Emacs-Version: " emacs-version)
+                    (erc-make-notice
+                     (concat "This buffer displays all IRC protocol "
+                             "traffic exchanged with servers."))
+                    (erc-make-notice "Kill it to disable logging.")
+                    (erc-make-notice "Press `t' to toggle."))))
+          (insert (string-join msg "\r\n")))
         (use-local-map (make-sparse-keymap))
         (local-set-key (kbd "t") 'erc-toggle-debug-irc-protocol))
       (add-hook 'kill-buffer-hook
-- 
2.31.1


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Add-CRLF-to-outgoing-ERC-protocol-logger-lines.patch

From 2dcb68486a49d59376778aea97a23ada1af5c1f4 Mon Sep 17 00:00:00 2001
From: "F. Jason Park" <jp@HIDDEN>
Date: Mon, 14 Jun 2021 22:24:01 -0700
Subject: [PATCH 1/1] Add CRLF to outgoing ERC protocol logger lines

* erc.el (erc-debug-irc-protocol): Fix line-ending mismatch between
incoming and outgoing logger lines without changing interface. Do this
by adding carriage returns to the latter to improve machine
readability. Change printed peer labels to most accurately reflect
logical endpoints.

(erc-debug-irc-protocol-time-format): Add new variable to support
timestamps in protocol logger output.

(erc-debug-irc-protocol-version): Add new variable to help tooling
track logging format independent of ERC and Emacs versions.

(erc-toggle-debug-irc-protocol): Add headers to protocol-log buffer
to aid future bug-reproduction tools. Clean up overlong lines.

This is bug#50009.
---
 lisp/erc/erc.el            | 79 +++++++++++++++++++++++++-------------
 test/lisp/erc/erc-tests.el | 36 +++++++++++++++++
 2 files changed, 88 insertions(+), 27 deletions(-)

diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index f01a99a30a..fe4ec52880 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -2312,6 +2312,22 @@ erc-error
 
 ;;; Debugging the protocol
 
+(defvar erc-debug-irc-protocol-time-format "%FT%T.%6N%z "
+  "Timestamp format string for protocol logger.")
+
+(defconst erc-debug-irc-protocol-version "1"
+  "Protocol log format version number.
+This exists to help tooling track changes to the format.
+
+In version 1, everything before and including the first double CRLF is
+front matter, which must also be CRLF terminated.  Lines beginning with
+three asterisks must be ignored as comments.  Other lines should be
+interpreted as email-style headers.  Folding is not supported.  A second
+double CRLF, if present, signals the end of a log.  Session resumption
+is not supported.  Logger lines must adhere to the following format:
+TIMESTAMP PEER-NAME FLOW-INDICATOR IRC-MESSAGE CRLF.  Outgoing messages
+are indicated with a >> and incoming with a <<.")
+
 (defvar erc-debug-irc-protocol nil
   "If non-nil, log all IRC protocol traffic to the buffer \"*erc-protocol*\".
 
@@ -2333,32 +2349,32 @@ erc-log-irc-protocol
 
 The buffer is created if it doesn't exist.
 
-If OUTBOUND is non-nil, STRING is being sent to the IRC server
-and appears in face `erc-input-face' in the buffer."
+If OUTBOUND is non-nil, STRING is being sent to the IRC server and
+appears in face `erc-input-face' in the buffer.  Lines must already
+contain CRLF endings.  Peer is identified by the most precise label
+available at run time, starting with the network name, followed by the
+announced host name, and falling back to the dialed <server>:<port>."
   (when erc-debug-irc-protocol
-    (let ((network-name (or (ignore-errors (erc-network-name))
-                            "???")))
+    (let ((esid (or (and (fboundp 'erc-network)
+                         (erc-network)
+                         (erc-network-name))
+                    erc-server-announced-name
+                    (format "%s:%s" erc-session-server erc-session-port)))
+          (ts (when erc-debug-irc-protocol-time-format
+                (format-time-string erc-debug-irc-protocol-time-format))))
       (with-current-buffer (get-buffer-create "*erc-protocol*")
         (save-excursion
           (goto-char (point-max))
           (let ((inhibit-read-only t))
-            (insert (if (not outbound)
-                        ;; Cope with the fact that string might
-                        ;; contain multiple lines of text.
-                        (let ((lines (delete "" (split-string string
-                                                              "\n\\|\r\n")))
-                              (result ""))
-                          (dolist (line lines)
-                            (setq result (concat result network-name
-                                                 " << " line "\n")))
-                          result)
-                      (propertize
-                       (concat network-name " >> " string
-                               (if (/= ?\n
-                                       (aref string
-                                             (1- (length string))))
-                                   "\n"))
-                       'font-lock-face 'erc-input-face)))))
+            (insert (if outbound
+                        (concat ts esid " >> " string)
+                      ;; Cope with multi-line messages
+                      (let ((lines (split-string string "[\r\n]+" t))
+                            result)
+                        (dolist (line lines)
+                          (setq result (concat result ts esid
+                                               " << " line "\r\n")))
+                        result)))))
         (let ((orig-win (selected-window))
               (debug-buffer-window (get-buffer-window (current-buffer) t)))
           (when debug-buffer-window
@@ -2377,9 +2393,16 @@ erc-toggle-debug-irc-protocol
     (with-current-buffer buf
       (view-mode-enter)
       (when (null (current-local-map))
-        (let ((inhibit-read-only t))
-          (insert (erc-make-notice "This buffer displays all IRC protocol traffic exchanged with each server.\n"))
-          (insert (erc-make-notice "Kill this buffer to terminate protocol logging.\n\n")))
+        (let ((inhibit-read-only t)
+              (msg (list
+                    (concat "Version: " erc-debug-irc-protocol-version)
+                    (concat "Emacs-Version: " emacs-version)
+                    (erc-make-notice
+                     (concat "This buffer displays all IRC protocol "
+                             "traffic exchanged with servers."))
+                    (erc-make-notice "Kill it to disable logging.")
+                    (erc-make-notice "Press `t' to toggle."))))
+          (insert (string-join msg "\r\n")))
         (use-local-map (make-sparse-keymap))
         (local-set-key (kbd "t") 'erc-toggle-debug-irc-protocol))
       (add-hook 'kill-buffer-hook
@@ -2387,10 +2410,12 @@ erc-toggle-debug-irc-protocol
                 nil 'local)
       (goto-char (point-max))
       (let ((inhibit-read-only t))
-        (insert (erc-make-notice
-                 (format "IRC protocol logging %s at %s -- Press `t' to toggle logging.\n"
+        (insert (if erc-debug-irc-protocol "\r\n" "")
+                (erc-make-notice
+                 (format "IRC protocol logging %s at %s"
                          (if erc-debug-irc-protocol "disabled" "enabled")
-                         (current-time-string))))))
+                         (current-time-string)))
+                (if erc-debug-irc-protocol "\r\n" "\r\n\r\n"))))
     (setq erc-debug-irc-protocol (not erc-debug-irc-protocol))
     (if (and arg
              (not (get-buffer-window "*erc-protocol*" t)))
diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el
index d13397274a..7a0867a0a1 100644
--- a/test/lisp/erc/erc-tests.el
+++ b/test/lisp/erc/erc-tests.el
@@ -24,6 +24,7 @@
 (require 'ert)
 (require 'erc)
 (require 'erc-ring)
+(require 'erc-networks)
 
 (ert-deftest erc--read-time-period ()
   (cl-letf (((symbol-function 'read-string) (lambda (&rest _) "")))
@@ -109,3 +110,38 @@ erc-ring-previous-command
         (should (looking-at "abc")))))
   (when noninteractive
     (kill-buffer "*#fake*")))
+
+(ert-deftest erc-log-irc-protocol ()
+  (should-not erc-debug-irc-protocol)
+  (with-temp-buffer
+    (setq erc-server-process (start-process "fake" (current-buffer) "true")
+          erc-server-current-nick "tester"
+          erc-session-server "myproxy.localhost"
+          erc-session-port 6667)
+    (let ((inhibit-message noninteractive))
+      (erc-toggle-debug-irc-protocol)
+      (erc-log-irc-protocol "PASS changeme\r\n" 'outgoing)
+      (setq erc-server-announced-name "irc.gnu.org")
+      (erc-log-irc-protocol ":irc.gnu.org 001 tester :Welcome")
+      (erc-log-irc-protocol ":irc.gnu.org 002 tester :Your host is irc.gnu.org")
+      (setq erc-network 'FooNet)
+      (erc-log-irc-protocol ":irc.gnu.org 422 tester :MOTD missing")
+      (setq erc-network 'BarNet)
+      (erc-log-irc-protocol ":irc.gnu.org 221 tester +i")
+      (set-process-query-on-exit-flag erc-server-process nil)))
+  (with-current-buffer "*erc-protocol*"
+    (goto-char (point-min))
+    (search-forward "Version")
+    (search-forward "\r\n\r\n")
+    (search-forward "myproxy.localhost:6667 >> PASS" (line-end-position))
+    (forward-line)
+    (search-forward "irc.gnu.org << :irc.gnu.org 001" (line-end-position))
+    (forward-line)
+    (search-forward "irc.gnu.org << :irc.gnu.org 002" (line-end-position))
+    (forward-line)
+    (search-forward "FooNet << :irc.gnu.org 422" (line-end-position))
+    (forward-line)
+    (search-forward "BarNet << :irc.gnu.org 221" (line-end-position)))
+  (when noninteractive
+    (kill-buffer "*erc-protocol*")
+    (should-not erc-debug-irc-protocol)))
-- 
2.31.1


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50009; Package emacs. Full text available.

Message received at 50009 <at> debbugs.gnu.org:


Received: (at 50009) by debbugs.gnu.org; 13 Sep 2021 03:05:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 12 23:05:03 2021
Received: from localhost ([127.0.0.1]:43808 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mPcHG-0001js-Ls
	for submit <at> debbugs.gnu.org; Sun, 12 Sep 2021 23:05:03 -0400
Received: from mail-108-mta7.mxroute.com ([136.175.108.7]:45135)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jp@HIDDEN>) id 1mPcHB-0001jI-T1
 for 50009 <at> debbugs.gnu.org; Sun, 12 Sep 2021 23:05:01 -0400
Received: from filter004.mxroute.com ([149.28.56.236] filter004.mxroute.com)
 (Authenticated sender: mN4UYu2MZsgR)
 by mail-108-mta7.mxroute.com (ZoneMTA) with ESMTPSA id 17bdd1d4a4100074ba.001
 for <50009 <at> debbugs.gnu.org>
 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256);
 Mon, 13 Sep 2021 03:04:49 +0000
X-Zone-Loop: ab936c35e1adf1c92963ceeb98bd0286a57c83e6df36
X-Originating-IP: [149.28.56.236]
From: "J.P." <jp@HIDDEN>
To: 50009 <at> debbugs.gnu.org
Subject: Re: bug#50009: 28.0.50; add CRLF to outgoing ERC protocol logger lines
References: <87v94chxbh.fsf@HIDDEN>
Date: Sun, 12 Sep 2021 20:04:47 -0700
In-Reply-To: <87v94chxbh.fsf@HIDDEN> (J. P.'s message of "Wed, 11 Aug
 2021 07:26:26 -0700")
Message-ID: <87y281tbu8.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-AuthUser: masked@HIDDEN
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 50009
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

v4. Ugh, so the last one was still failing intermittently (on 27).
Should be good now.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=0000-NOT-A-PATCH-v3-v4.diff

From 10aa53faea8b17ef659f166fdaf6da4191831aa1 Mon Sep 17 00:00:00 2001
From: "F. Jason Park" <jp@HIDDEN>
Date: Sun, 12 Sep 2021 19:25:41 -0700
Subject: [PATCH 0/1] *** SUBJECT HERE ***

*** BLURB HERE ***

F. Jason Park (1):
  Add CRLF to outgoing ERC protocol logger lines

 lisp/erc/erc.el            | 77 ++++++++++++++++++++++++--------------
 test/lisp/erc/erc-tests.el | 36 ++++++++++++++++++
 2 files changed, 85 insertions(+), 28 deletions(-)

Interdiff:
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 033c392502..524a22e5a1 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -2405,8 +2405,6 @@ erc-toggle-debug-irc-protocol
                 (lambda () (setq erc-debug-irc-protocol nil))
                 nil 'local)
       (goto-char (point-max))
-      ;; Searchable phrase printed twice between logs and once before
-      ;; the first. This is a single line with CRLF endings.
       (let ((inhibit-read-only t))
         (insert (if erc-debug-irc-protocol "\r\n" "")
                 (erc-make-notice
diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el
index f94b52ec9f..7a0867a0a1 100644
--- a/test/lisp/erc/erc-tests.el
+++ b/test/lisp/erc/erc-tests.el
@@ -114,13 +114,11 @@ erc-ring-previous-command
 (ert-deftest erc-log-irc-protocol ()
   (should-not erc-debug-irc-protocol)
   (with-temp-buffer
-    (let (erc-server-announced-name
-          erc-network
-          (erc-server-process (start-process "fake" (current-buffer) "true"))
-          (erc-server-current-nick "tester")
-          (erc-session-server "myproxy.localhost")
-          (erc-session-port 6667)
-          (inhibit-message t))
+    (setq erc-server-process (start-process "fake" (current-buffer) "true")
+          erc-server-current-nick "tester"
+          erc-session-server "myproxy.localhost"
+          erc-session-port 6667)
+    (let ((inhibit-message noninteractive))
       (erc-toggle-debug-irc-protocol)
       (erc-log-irc-protocol "PASS changeme\r\n" 'outgoing)
       (setq erc-server-announced-name "irc.gnu.org")
@@ -130,18 +128,20 @@ erc-log-irc-protocol
       (erc-log-irc-protocol ":irc.gnu.org 422 tester :MOTD missing")
       (setq erc-network 'BarNet)
       (erc-log-irc-protocol ":irc.gnu.org 221 tester +i")
-      (delete-process erc-server-process)))
+      (set-process-query-on-exit-flag erc-server-process nil)))
   (with-current-buffer "*erc-protocol*"
     (goto-char (point-min))
-    (search-forward "myproxy.localhost:6667 >> PASS")
+    (search-forward "Version")
+    (search-forward "\r\n\r\n")
+    (search-forward "myproxy.localhost:6667 >> PASS" (line-end-position))
     (forward-line)
-    (search-forward "irc.gnu.org << :irc.gnu.org 001")
+    (search-forward "irc.gnu.org << :irc.gnu.org 001" (line-end-position))
     (forward-line)
-    (search-forward "irc.gnu.org << :irc.gnu.org 002")
+    (search-forward "irc.gnu.org << :irc.gnu.org 002" (line-end-position))
     (forward-line)
-    (search-forward "FooNet << :irc.gnu.org 422")
+    (search-forward "FooNet << :irc.gnu.org 422" (line-end-position))
     (forward-line)
-    (search-forward "BarNet << :irc.gnu.org 221"))
+    (search-forward "BarNet << :irc.gnu.org 221" (line-end-position)))
   (when noninteractive
     (kill-buffer "*erc-protocol*")
     (should-not erc-debug-irc-protocol)))
-- 
2.31.1


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Add-CRLF-to-outgoing-ERC-protocol-logger-lines.patch

From 10aa53faea8b17ef659f166fdaf6da4191831aa1 Mon Sep 17 00:00:00 2001
From: "F. Jason Park" <jp@HIDDEN>
Date: Mon, 14 Jun 2021 22:24:01 -0700
Subject: [PATCH 1/1] Add CRLF to outgoing ERC protocol logger lines

* erc.el (erc-debug-irc-protocol): Fix line-ending mismatch between
incoming and outgoing logger lines without changing interface. Do this
by adding carriage returns to the latter to improve machine
readability. Change printed peer labels to most accurately reflect
logical endpoints.

(erc-debug-irc-protocol-time-format): Add new variable to support
timestamps in protocol logger output.

(erc-debug-irc-protocol-version): Add new variable to help tooling
track logging format independent of ERC and Emacs versions.

(erc-toggle-debug-irc-protocol): Add headers to protocol-log buffer
to aid future bug-reproduction tools. Clean up overlong lines.

This is bug#50009.
---
 lisp/erc/erc.el            | 77 ++++++++++++++++++++++++--------------
 test/lisp/erc/erc-tests.el | 36 ++++++++++++++++++
 2 files changed, 85 insertions(+), 28 deletions(-)

diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index f01a99a30a..524a22e5a1 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -2312,6 +2312,13 @@ erc-error
 
 ;;; Debugging the protocol
 
+(defvar erc-debug-irc-protocol-time-format "%FT%T.%6N%z "
+  "Timestamp format string for protocol logger.")
+
+(defconst erc-debug-irc-protocol-version "1"
+  "Protocol log format version number.
+This is to help tooling track changes to the format.")
+
 (defvar erc-debug-irc-protocol nil
   "If non-nil, log all IRC protocol traffic to the buffer \"*erc-protocol*\".
 
@@ -2333,32 +2340,36 @@ erc-log-irc-protocol
 
 The buffer is created if it doesn't exist.
 
-If OUTBOUND is non-nil, STRING is being sent to the IRC server
-and appears in face `erc-input-face' in the buffer."
+If OUTBOUND is non-nil, STRING is being sent to the IRC server and
+appears in face `erc-input-face' in the buffer.  Lines must already
+contain CRLF endings.  Peer is identified by the most precise label
+available at run time, starting with the network name, followed by the
+self-reported host name, and falling back to the dialed <server>:<port>.
+When capturing logs for multiple peers and sorting them into buckets,
+such inconsistent labeling may pose a problem during an initial server
+burst.  For now, the recommended approach is to wrap this function with
+advice that temporarily redefines the symbol-function `erc-network'."
   (when erc-debug-irc-protocol
-    (let ((network-name (or (ignore-errors (erc-network-name))
-                            "???")))
+    (let ((esid (or (and (fboundp 'erc-network)
+                         (erc-network)
+                         (erc-network-name))
+                    erc-server-announced-name
+                    (format "%s:%s" erc-session-server erc-session-port)))
+          (ts (when erc-debug-irc-protocol-time-format
+                (format-time-string erc-debug-irc-protocol-time-format))))
       (with-current-buffer (get-buffer-create "*erc-protocol*")
         (save-excursion
           (goto-char (point-max))
           (let ((inhibit-read-only t))
-            (insert (if (not outbound)
-                        ;; Cope with the fact that string might
-                        ;; contain multiple lines of text.
-                        (let ((lines (delete "" (split-string string
-                                                              "\n\\|\r\n")))
-                              (result ""))
-                          (dolist (line lines)
-                            (setq result (concat result network-name
-                                                 " << " line "\n")))
-                          result)
-                      (propertize
-                       (concat network-name " >> " string
-                               (if (/= ?\n
-                                       (aref string
-                                             (1- (length string))))
-                                   "\n"))
-                       'font-lock-face 'erc-input-face)))))
+            (insert (if outbound
+                        (concat ts esid " >> " string)
+                      ;; Cope with multi-line messages
+                      (let ((lines (split-string string "[\r\n]+" t))
+                            result)
+                        (dolist (line lines)
+                          (setq result (concat result ts esid
+                                               " << " line "\r\n")))
+                        result)))))
         (let ((orig-win (selected-window))
               (debug-buffer-window (get-buffer-window (current-buffer) t)))
           (when debug-buffer-window
@@ -2371,15 +2382,23 @@ erc-log-irc-protocol
 (defun erc-toggle-debug-irc-protocol (&optional arg)
   "Toggle the value of `erc-debug-irc-protocol'.
 
-If ARG is non-nil, show the *erc-protocol* buffer."
+If ARG is non-nil, show the *erc-protocol* buffer.  Everything before
+and including the first double CRLF is front matter.  Everything before
+the first double linefeed is a header."
   (interactive "P")
   (let* ((buf (get-buffer-create "*erc-protocol*")))
     (with-current-buffer buf
       (view-mode-enter)
       (when (null (current-local-map))
-        (let ((inhibit-read-only t))
-          (insert (erc-make-notice "This buffer displays all IRC protocol traffic exchanged with each server.\n"))
-          (insert (erc-make-notice "Kill this buffer to terminate protocol logging.\n\n")))
+        (let ((inhibit-read-only t)
+              (headers (concat "Version: " erc-debug-irc-protocol-version "\n"
+                               "Emacs-Version: " emacs-version "\n"
+                               "\n"))
+              (msg (concat "This buffer displays all IRC protocol traffic "
+                           "exchanged with servers.\n"
+                           "Kill it to disable logging.\n"
+                           "Press `t' to toggle.\n")))
+          (insert headers (erc-make-notice msg)))
         (use-local-map (make-sparse-keymap))
         (local-set-key (kbd "t") 'erc-toggle-debug-irc-protocol))
       (add-hook 'kill-buffer-hook
@@ -2387,10 +2406,12 @@ erc-toggle-debug-irc-protocol
                 nil 'local)
       (goto-char (point-max))
       (let ((inhibit-read-only t))
-        (insert (erc-make-notice
-                 (format "IRC protocol logging %s at %s -- Press `t' to toggle logging.\n"
+        (insert (if erc-debug-irc-protocol "\r\n" "")
+                (erc-make-notice
+                 (format "IRC protocol logging %s at %s"
                          (if erc-debug-irc-protocol "disabled" "enabled")
-                         (current-time-string))))))
+                         (current-time-string)))
+                (if erc-debug-irc-protocol "\r\n" "\r\n\r\n"))))
     (setq erc-debug-irc-protocol (not erc-debug-irc-protocol))
     (if (and arg
              (not (get-buffer-window "*erc-protocol*" t)))
diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el
index d13397274a..7a0867a0a1 100644
--- a/test/lisp/erc/erc-tests.el
+++ b/test/lisp/erc/erc-tests.el
@@ -24,6 +24,7 @@
 (require 'ert)
 (require 'erc)
 (require 'erc-ring)
+(require 'erc-networks)
 
 (ert-deftest erc--read-time-period ()
   (cl-letf (((symbol-function 'read-string) (lambda (&rest _) "")))
@@ -109,3 +110,38 @@ erc-ring-previous-command
         (should (looking-at "abc")))))
   (when noninteractive
     (kill-buffer "*#fake*")))
+
+(ert-deftest erc-log-irc-protocol ()
+  (should-not erc-debug-irc-protocol)
+  (with-temp-buffer
+    (setq erc-server-process (start-process "fake" (current-buffer) "true")
+          erc-server-current-nick "tester"
+          erc-session-server "myproxy.localhost"
+          erc-session-port 6667)
+    (let ((inhibit-message noninteractive))
+      (erc-toggle-debug-irc-protocol)
+      (erc-log-irc-protocol "PASS changeme\r\n" 'outgoing)
+      (setq erc-server-announced-name "irc.gnu.org")
+      (erc-log-irc-protocol ":irc.gnu.org 001 tester :Welcome")
+      (erc-log-irc-protocol ":irc.gnu.org 002 tester :Your host is irc.gnu.org")
+      (setq erc-network 'FooNet)
+      (erc-log-irc-protocol ":irc.gnu.org 422 tester :MOTD missing")
+      (setq erc-network 'BarNet)
+      (erc-log-irc-protocol ":irc.gnu.org 221 tester +i")
+      (set-process-query-on-exit-flag erc-server-process nil)))
+  (with-current-buffer "*erc-protocol*"
+    (goto-char (point-min))
+    (search-forward "Version")
+    (search-forward "\r\n\r\n")
+    (search-forward "myproxy.localhost:6667 >> PASS" (line-end-position))
+    (forward-line)
+    (search-forward "irc.gnu.org << :irc.gnu.org 001" (line-end-position))
+    (forward-line)
+    (search-forward "irc.gnu.org << :irc.gnu.org 002" (line-end-position))
+    (forward-line)
+    (search-forward "FooNet << :irc.gnu.org 422" (line-end-position))
+    (forward-line)
+    (search-forward "BarNet << :irc.gnu.org 221" (line-end-position)))
+  (when noninteractive
+    (kill-buffer "*erc-protocol*")
+    (should-not erc-debug-irc-protocol)))
-- 
2.31.1


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50009; Package emacs. Full text available.

Message received at 50009 <at> debbugs.gnu.org:


Received: (at 50009) by debbugs.gnu.org; 13 Sep 2021 00:52:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 12 20:52:21 2021
Received: from localhost ([127.0.0.1]:43702 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mPaCq-0002a2-Fh
	for submit <at> debbugs.gnu.org; Sun, 12 Sep 2021 20:52:21 -0400
Received: from mail-108-mta17.mxroute.com ([136.175.108.17]:36537)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jp@HIDDEN>) id 1mPaCo-0002Zm-74
 for 50009 <at> debbugs.gnu.org; Sun, 12 Sep 2021 20:52:19 -0400
Received: from filter004.mxroute.com ([149.28.56.236] filter004.mxroute.com)
 (Authenticated sender: mN4UYu2MZsgR)
 by mail-108-mta17.mxroute.com (ZoneMTA) with ESMTPSA id 17bdca3d02400074ba.001
 for <50009 <at> debbugs.gnu.org>
 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256);
 Mon, 13 Sep 2021 00:52:08 +0000
X-Zone-Loop: 458db51cad49141778954b6b5bf82eae0d6d1d8b3c3a
X-Originating-IP: [149.28.56.236]
From: "J.P." <jp@HIDDEN>
To: 50009 <at> debbugs.gnu.org
Subject: Re: bug#50009: 28.0.50; add CRLF to outgoing ERC protocol logger lines
References: <87v94chxbh.fsf@HIDDEN>
Date: Sun, 12 Sep 2021 17:52:05 -0700
In-Reply-To: <87v94chxbh.fsf@HIDDEN> (J. P.'s message of "Wed, 11 Aug
 2021 07:26:26 -0700")
Message-ID: <87r1dtuwju.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-AuthUser: masked@HIDDEN
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50009
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

v3. Fix process-query-on-exit problem in unit test.

--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=0000-NOT-A-PATCH-v2-v3.diff

From c9c51984e2caa303e7f008272ea2bc806dbf3cc0 Mon Sep 17 00:00:00 2001
From: "F. Jason Park" <jp@HIDDEN>
Date: Sun, 12 Sep 2021 17:34:16 -0700
Subject: [PATCH 0/1] *** SUBJECT HERE ***

*** BLURB HERE ***

F. Jason Park (1):
  Add CRLF to outgoing ERC protocol logger lines

 lisp/erc/erc.el            | 79 ++++++++++++++++++++++++--------------
 test/lisp/erc/erc-tests.el | 36 +++++++++++++++++
 2 files changed, 87 insertions(+), 28 deletions(-)

Interdiff:
diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el
index 5a362628fa..f94b52ec9f 100644
--- a/test/lisp/erc/erc-tests.el
+++ b/test/lisp/erc/erc-tests.el
@@ -129,7 +129,8 @@ erc-log-irc-protocol
       (setq erc-network 'FooNet)
       (erc-log-irc-protocol ":irc.gnu.org 422 tester :MOTD missing")
       (setq erc-network 'BarNet)
-      (erc-log-irc-protocol ":irc.gnu.org 221 tester +i")))
+      (erc-log-irc-protocol ":irc.gnu.org 221 tester +i")
+      (delete-process erc-server-process)))
   (with-current-buffer "*erc-protocol*"
     (goto-char (point-min))
     (search-forward "myproxy.localhost:6667 >> PASS")
-- 
2.31.1


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Add-CRLF-to-outgoing-ERC-protocol-logger-lines.patch

From c9c51984e2caa303e7f008272ea2bc806dbf3cc0 Mon Sep 17 00:00:00 2001
From: "F. Jason Park" <jp@HIDDEN>
Date: Mon, 14 Jun 2021 22:24:01 -0700
Subject: [PATCH 1/1] Add CRLF to outgoing ERC protocol logger lines

* erc.el (erc-debug-irc-protocol): Fix line-ending mismatch between
incoming and outgoing logger lines without changing interface. Do this
by adding carriage returns to the latter to improve machine
readability. Change printed peer labels to most accurately reflect
logical endpoints.

(erc-debug-irc-protocol-time-format): Add new variable to support
timestamps in protocol logger output.

(erc-debug-irc-protocol-version): Add new variable to help tooling
track logging format independent of ERC and Emacs versions.

(erc-toggle-debug-irc-protocol): Add headers to protocol-log buffer
to aid future bug-reproduction tools. Clean up overlong lines.

This is bug#50009.
---
 lisp/erc/erc.el            | 79 ++++++++++++++++++++++++--------------
 test/lisp/erc/erc-tests.el | 36 +++++++++++++++++
 2 files changed, 87 insertions(+), 28 deletions(-)

diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index f01a99a30a..033c392502 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -2312,6 +2312,13 @@ erc-error
 
 ;;; Debugging the protocol
 
+(defvar erc-debug-irc-protocol-time-format "%FT%T.%6N%z "
+  "Timestamp format string for protocol logger.")
+
+(defconst erc-debug-irc-protocol-version "1"
+  "Protocol log format version number.
+This is to help tooling track changes to the format.")
+
 (defvar erc-debug-irc-protocol nil
   "If non-nil, log all IRC protocol traffic to the buffer \"*erc-protocol*\".
 
@@ -2333,32 +2340,36 @@ erc-log-irc-protocol
 
 The buffer is created if it doesn't exist.
 
-If OUTBOUND is non-nil, STRING is being sent to the IRC server
-and appears in face `erc-input-face' in the buffer."
+If OUTBOUND is non-nil, STRING is being sent to the IRC server and
+appears in face `erc-input-face' in the buffer.  Lines must already
+contain CRLF endings.  Peer is identified by the most precise label
+available at run time, starting with the network name, followed by the
+self-reported host name, and falling back to the dialed <server>:<port>.
+When capturing logs for multiple peers and sorting them into buckets,
+such inconsistent labeling may pose a problem during an initial server
+burst.  For now, the recommended approach is to wrap this function with
+advice that temporarily redefines the symbol-function `erc-network'."
   (when erc-debug-irc-protocol
-    (let ((network-name (or (ignore-errors (erc-network-name))
-                            "???")))
+    (let ((esid (or (and (fboundp 'erc-network)
+                         (erc-network)
+                         (erc-network-name))
+                    erc-server-announced-name
+                    (format "%s:%s" erc-session-server erc-session-port)))
+          (ts (when erc-debug-irc-protocol-time-format
+                (format-time-string erc-debug-irc-protocol-time-format))))
       (with-current-buffer (get-buffer-create "*erc-protocol*")
         (save-excursion
           (goto-char (point-max))
           (let ((inhibit-read-only t))
-            (insert (if (not outbound)
-                        ;; Cope with the fact that string might
-                        ;; contain multiple lines of text.
-                        (let ((lines (delete "" (split-string string
-                                                              "\n\\|\r\n")))
-                              (result ""))
-                          (dolist (line lines)
-                            (setq result (concat result network-name
-                                                 " << " line "\n")))
-                          result)
-                      (propertize
-                       (concat network-name " >> " string
-                               (if (/= ?\n
-                                       (aref string
-                                             (1- (length string))))
-                                   "\n"))
-                       'font-lock-face 'erc-input-face)))))
+            (insert (if outbound
+                        (concat ts esid " >> " string)
+                      ;; Cope with multi-line messages
+                      (let ((lines (split-string string "[\r\n]+" t))
+                            result)
+                        (dolist (line lines)
+                          (setq result (concat result ts esid
+                                               " << " line "\r\n")))
+                        result)))))
         (let ((orig-win (selected-window))
               (debug-buffer-window (get-buffer-window (current-buffer) t)))
           (when debug-buffer-window
@@ -2371,26 +2382,38 @@ erc-log-irc-protocol
 (defun erc-toggle-debug-irc-protocol (&optional arg)
   "Toggle the value of `erc-debug-irc-protocol'.
 
-If ARG is non-nil, show the *erc-protocol* buffer."
+If ARG is non-nil, show the *erc-protocol* buffer.  Everything before
+and including the first double CRLF is front matter.  Everything before
+the first double linefeed is a header."
   (interactive "P")
   (let* ((buf (get-buffer-create "*erc-protocol*")))
     (with-current-buffer buf
       (view-mode-enter)
       (when (null (current-local-map))
-        (let ((inhibit-read-only t))
-          (insert (erc-make-notice "This buffer displays all IRC protocol traffic exchanged with each server.\n"))
-          (insert (erc-make-notice "Kill this buffer to terminate protocol logging.\n\n")))
+        (let ((inhibit-read-only t)
+              (headers (concat "Version: " erc-debug-irc-protocol-version "\n"
+                               "Emacs-Version: " emacs-version "\n"
+                               "\n"))
+              (msg (concat "This buffer displays all IRC protocol traffic "
+                           "exchanged with servers.\n"
+                           "Kill it to disable logging.\n"
+                           "Press `t' to toggle.\n")))
+          (insert headers (erc-make-notice msg)))
         (use-local-map (make-sparse-keymap))
         (local-set-key (kbd "t") 'erc-toggle-debug-irc-protocol))
       (add-hook 'kill-buffer-hook
                 (lambda () (setq erc-debug-irc-protocol nil))
                 nil 'local)
       (goto-char (point-max))
+      ;; Searchable phrase printed twice between logs and once before
+      ;; the first. This is a single line with CRLF endings.
       (let ((inhibit-read-only t))
-        (insert (erc-make-notice
-                 (format "IRC protocol logging %s at %s -- Press `t' to toggle logging.\n"
+        (insert (if erc-debug-irc-protocol "\r\n" "")
+                (erc-make-notice
+                 (format "IRC protocol logging %s at %s"
                          (if erc-debug-irc-protocol "disabled" "enabled")
-                         (current-time-string))))))
+                         (current-time-string)))
+                (if erc-debug-irc-protocol "\r\n" "\r\n\r\n"))))
     (setq erc-debug-irc-protocol (not erc-debug-irc-protocol))
     (if (and arg
              (not (get-buffer-window "*erc-protocol*" t)))
diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el
index d13397274a..f94b52ec9f 100644
--- a/test/lisp/erc/erc-tests.el
+++ b/test/lisp/erc/erc-tests.el
@@ -24,6 +24,7 @@
 (require 'ert)
 (require 'erc)
 (require 'erc-ring)
+(require 'erc-networks)
 
 (ert-deftest erc--read-time-period ()
   (cl-letf (((symbol-function 'read-string) (lambda (&rest _) "")))
@@ -109,3 +110,38 @@ erc-ring-previous-command
         (should (looking-at "abc")))))
   (when noninteractive
     (kill-buffer "*#fake*")))
+
+(ert-deftest erc-log-irc-protocol ()
+  (should-not erc-debug-irc-protocol)
+  (with-temp-buffer
+    (let (erc-server-announced-name
+          erc-network
+          (erc-server-process (start-process "fake" (current-buffer) "true"))
+          (erc-server-current-nick "tester")
+          (erc-session-server "myproxy.localhost")
+          (erc-session-port 6667)
+          (inhibit-message t))
+      (erc-toggle-debug-irc-protocol)
+      (erc-log-irc-protocol "PASS changeme\r\n" 'outgoing)
+      (setq erc-server-announced-name "irc.gnu.org")
+      (erc-log-irc-protocol ":irc.gnu.org 001 tester :Welcome")
+      (erc-log-irc-protocol ":irc.gnu.org 002 tester :Your host is irc.gnu.org")
+      (setq erc-network 'FooNet)
+      (erc-log-irc-protocol ":irc.gnu.org 422 tester :MOTD missing")
+      (setq erc-network 'BarNet)
+      (erc-log-irc-protocol ":irc.gnu.org 221 tester +i")
+      (delete-process erc-server-process)))
+  (with-current-buffer "*erc-protocol*"
+    (goto-char (point-min))
+    (search-forward "myproxy.localhost:6667 >> PASS")
+    (forward-line)
+    (search-forward "irc.gnu.org << :irc.gnu.org 001")
+    (forward-line)
+    (search-forward "irc.gnu.org << :irc.gnu.org 002")
+    (forward-line)
+    (search-forward "FooNet << :irc.gnu.org 422")
+    (forward-line)
+    (search-forward "BarNet << :irc.gnu.org 221"))
+  (when noninteractive
+    (kill-buffer "*erc-protocol*")
+    (should-not erc-debug-irc-protocol)))
-- 
2.31.1


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50009; Package emacs. Full text available.

Message received at 50009 <at> debbugs.gnu.org:


Received: (at 50009) by debbugs.gnu.org; 12 Sep 2021 12:04:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 12 08:04:44 2021
Received: from localhost ([127.0.0.1]:42192 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mPODz-0004hq-Sv
	for submit <at> debbugs.gnu.org; Sun, 12 Sep 2021 08:04:44 -0400
Received: from mail-108-mta51.mxroute.com ([136.175.108.51]:42173)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jp@HIDDEN>) id 1mPODw-0004hb-4x
 for 50009 <at> debbugs.gnu.org; Sun, 12 Sep 2021 08:04:43 -0400
Received: from filter004.mxroute.com ([149.28.56.236] filter004.mxroute.com)
 (Authenticated sender: mN4UYu2MZsgR)
 by mail-108-mta51.mxroute.com (ZoneMTA) with ESMTPSA id 17bd9e50d5300074ba.001
 for <50009 <at> debbugs.gnu.org>
 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256);
 Sun, 12 Sep 2021 12:04:32 +0000
X-Zone-Loop: 7e95082a4710f9ea2de57e94c4a81b8bc91031b43c5b
X-Originating-IP: [149.28.56.236]
From: "J.P." <jp@HIDDEN>
To: 50009 <at> debbugs.gnu.org
Subject: Re: bug#50009: 28.0.50; add CRLF to outgoing ERC protocol logger lines
References: <87v94chxbh.fsf@HIDDEN>
Date: Sun, 12 Sep 2021 05:04:28 -0700
In-Reply-To: <87v94chxbh.fsf@HIDDEN> (J. P.'s message of "Wed, 11 Aug
 2021 07:26:26 -0700")
Message-ID: <87ee9uvw37.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-AuthUser: masked@HIDDEN
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 50009
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

v2. Tweaked some spacing and borrowed a unit test from bug#48598.

(Note: the first attachment just shows the changes from the last set and
is not itself a patch.)


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=0000-v1-v2.diff

From c4127a84f084166f2267c9745d1fc1f06ebbead2 Mon Sep 17 00:00:00 2001
From: "F. Jason Park" <jp@HIDDEN>
Date: Sun, 12 Sep 2021 04:44:23 -0700
Subject: [PATCH 0/1] *** SUBJECT HERE ***

*** BLURB HERE ***

F. Jason Park (1):
  Add CRLF to outgoing ERC protocol logger lines

 lisp/erc/erc.el            | 79 ++++++++++++++++++++++++--------------
 test/lisp/erc/erc-tests.el | 35 +++++++++++++++++
 2 files changed, 86 insertions(+), 28 deletions(-)

Interdiff:
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index f5ecb043b0..ead82b794d 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -2313,12 +2313,11 @@ erc-error
 ;;; Debugging the protocol
 
 (defvar erc-debug-irc-protocol-time-format "%FT%T.%6N%z "
-  "An optional format string for optional I/O timestamps.")
+  "Timestamp format string for protocol logger.")
 
 (defconst erc-debug-irc-protocol-version "1"
   "Protocol log format version number.
-These logs are machine-readable, but external tools used in bug
-reproduction, etc. need a way to track changes to the format.")
+This is to help tooling track changes to the format.")
 
 (defvar erc-debug-irc-protocol nil
   "If non-nil, log all IRC protocol traffic to the buffer \"*erc-protocol*\".
@@ -2384,8 +2383,8 @@ erc-toggle-debug-irc-protocol
   "Toggle the value of `erc-debug-irc-protocol'.
 
 If ARG is non-nil, show the *erc-protocol* buffer.  Everything before
-the first CRLF is front matter.  Everything before the first double
-linefeed is a header."
+and including the first double CRLF is front matter.  Everything before
+the first double linefeed is a header."
   (interactive "P")
   (let* ((buf (get-buffer-create "*erc-protocol*")))
     (with-current-buffer buf
@@ -2409,10 +2408,12 @@ erc-toggle-debug-irc-protocol
       ;; Searchable phrase printed twice between logs and once before
       ;; the first. This is a single line with CRLF endings.
       (let ((inhibit-read-only t))
-        (insert (erc-make-notice
-                 (format "IRC protocol logging %s at %s\r\n"
+        (insert (if erc-debug-irc-protocol "\r\n" "")
+                (erc-make-notice
+                 (format "IRC protocol logging %s at %s"
                          (if erc-debug-irc-protocol "disabled" "enabled")
-                         (current-time-string))))))
+                         (current-time-string)))
+                (if erc-debug-irc-protocol "\r\n" "\r\n\r\n"))))
     (setq erc-debug-irc-protocol (not erc-debug-irc-protocol))
     (if (and arg
              (not (get-buffer-window "*erc-protocol*" t)))
diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el
index d13397274a..5a362628fa 100644
--- a/test/lisp/erc/erc-tests.el
+++ b/test/lisp/erc/erc-tests.el
@@ -24,6 +24,7 @@
 (require 'ert)
 (require 'erc)
 (require 'erc-ring)
+(require 'erc-networks)
 
 (ert-deftest erc--read-time-period ()
   (cl-letf (((symbol-function 'read-string) (lambda (&rest _) "")))
@@ -109,3 +110,37 @@ erc-ring-previous-command
         (should (looking-at "abc")))))
   (when noninteractive
     (kill-buffer "*#fake*")))
+
+(ert-deftest erc-log-irc-protocol ()
+  (should-not erc-debug-irc-protocol)
+  (with-temp-buffer
+    (let (erc-server-announced-name
+          erc-network
+          (erc-server-process (start-process "fake" (current-buffer) "true"))
+          (erc-server-current-nick "tester")
+          (erc-session-server "myproxy.localhost")
+          (erc-session-port 6667)
+          (inhibit-message t))
+      (erc-toggle-debug-irc-protocol)
+      (erc-log-irc-protocol "PASS changeme\r\n" 'outgoing)
+      (setq erc-server-announced-name "irc.gnu.org")
+      (erc-log-irc-protocol ":irc.gnu.org 001 tester :Welcome")
+      (erc-log-irc-protocol ":irc.gnu.org 002 tester :Your host is irc.gnu.org")
+      (setq erc-network 'FooNet)
+      (erc-log-irc-protocol ":irc.gnu.org 422 tester :MOTD missing")
+      (setq erc-network 'BarNet)
+      (erc-log-irc-protocol ":irc.gnu.org 221 tester +i")))
+  (with-current-buffer "*erc-protocol*"
+    (goto-char (point-min))
+    (search-forward "myproxy.localhost:6667 >> PASS")
+    (forward-line)
+    (search-forward "irc.gnu.org << :irc.gnu.org 001")
+    (forward-line)
+    (search-forward "irc.gnu.org << :irc.gnu.org 002")
+    (forward-line)
+    (search-forward "FooNet << :irc.gnu.org 422")
+    (forward-line)
+    (search-forward "BarNet << :irc.gnu.org 221"))
+  (when noninteractive
+    (kill-buffer "*erc-protocol*")
+    (should-not erc-debug-irc-protocol)))
-- 
2.31.1


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Add-CRLF-to-outgoing-ERC-protocol-logger-lines.patch

From c4127a84f084166f2267c9745d1fc1f06ebbead2 Mon Sep 17 00:00:00 2001
From: "F. Jason Park" <jp@HIDDEN>
Date: Mon, 14 Jun 2021 22:24:01 -0700
Subject: [PATCH 1/1] Add CRLF to outgoing ERC protocol logger lines

* erc.el (erc-debug-irc-protocol): Fix line-ending mismatch between
incoming and outgoing logger lines without changing interface. Do this
by adding carriage returns to the latter to improve machine
readability. Change printed peer labels to most accurately reflect
logical endpoints.

(erc-debug-irc-protocol-time-format): Add new variable to support
timestamps in protocol logger output.

(erc-debug-irc-protocol-version): Add new variable to help tooling
track logging format independent of ERC and Emacs versions.

(erc-toggle-debug-irc-protocol): Add headers to protocol-log buffer
to aid future bug-reproduction tools. Clean up overlong lines.

This is bug#50009.
---
 lisp/erc/erc.el            | 79 ++++++++++++++++++++++++--------------
 test/lisp/erc/erc-tests.el | 35 +++++++++++++++++
 2 files changed, 86 insertions(+), 28 deletions(-)

diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index e0fda41f8e..ead82b794d 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -2312,6 +2312,13 @@ erc-error
 
 ;;; Debugging the protocol
 
+(defvar erc-debug-irc-protocol-time-format "%FT%T.%6N%z "
+  "Timestamp format string for protocol logger.")
+
+(defconst erc-debug-irc-protocol-version "1"
+  "Protocol log format version number.
+This is to help tooling track changes to the format.")
+
 (defvar erc-debug-irc-protocol nil
   "If non-nil, log all IRC protocol traffic to the buffer \"*erc-protocol*\".
 
@@ -2333,32 +2340,36 @@ erc-log-irc-protocol
 
 The buffer is created if it doesn't exist.
 
-If OUTBOUND is non-nil, STRING is being sent to the IRC server
-and appears in face `erc-input-face' in the buffer."
+If OUTBOUND is non-nil, STRING is being sent to the IRC server and
+appears in face `erc-input-face' in the buffer.  Lines must already
+contain CRLF endings.  Peer is identified by the most precise label
+available at run time, starting with the network name, followed by the
+self-reported host name, and falling back to the dialed <server>:<port>.
+When capturing logs for multiple peers and sorting them into buckets,
+such inconsistent labeling may pose a problem during an initial server
+burst.  For now, the recommended approach is to wrap this function with
+advice that temporarily redefines the symbol-function `erc-network'."
   (when erc-debug-irc-protocol
-    (let ((network-name (or (ignore-errors (erc-network-name))
-                            "???")))
+    (let ((esid (or (and (fboundp 'erc-network)
+                         (erc-network)
+                         (erc-network-name))
+                    erc-server-announced-name
+                    (format "%s:%s" erc-session-server erc-session-port)))
+          (ts (when erc-debug-irc-protocol-time-format
+                (format-time-string erc-debug-irc-protocol-time-format))))
       (with-current-buffer (get-buffer-create "*erc-protocol*")
         (save-excursion
           (goto-char (point-max))
           (let ((inhibit-read-only t))
-            (insert (if (not outbound)
-                        ;; Cope with the fact that string might
-                        ;; contain multiple lines of text.
-                        (let ((lines (delete "" (split-string string
-                                                              "\n\\|\r\n")))
-                              (result ""))
-                          (dolist (line lines)
-                            (setq result (concat result network-name
-                                                 " << " line "\n")))
-                          result)
-                      (propertize
-                       (concat network-name " >> " string
-                               (if (/= ?\n
-                                       (aref string
-                                             (1- (length string))))
-                                   "\n"))
-                       'font-lock-face 'erc-input-face)))))
+            (insert (if outbound
+                        (concat ts esid " >> " string)
+                      ;; Cope with multi-line messages
+                      (let ((lines (split-string string "[\r\n]+" t))
+                            result)
+                        (dolist (line lines)
+                          (setq result (concat result ts esid
+                                               " << " line "\r\n")))
+                        result)))))
         (let ((orig-win (selected-window))
               (debug-buffer-window (get-buffer-window (current-buffer) t)))
           (when debug-buffer-window
@@ -2371,26 +2382,38 @@ erc-log-irc-protocol
 (defun erc-toggle-debug-irc-protocol (&optional arg)
   "Toggle the value of `erc-debug-irc-protocol'.
 
-If ARG is non-nil, show the *erc-protocol* buffer."
+If ARG is non-nil, show the *erc-protocol* buffer.  Everything before
+and including the first double CRLF is front matter.  Everything before
+the first double linefeed is a header."
   (interactive "P")
   (let* ((buf (get-buffer-create "*erc-protocol*")))
     (with-current-buffer buf
       (view-mode-enter)
       (when (null (current-local-map))
-        (let ((inhibit-read-only t))
-          (insert (erc-make-notice "This buffer displays all IRC protocol traffic exchanged with each server.\n"))
-          (insert (erc-make-notice "Kill this buffer to terminate protocol logging.\n\n")))
+        (let ((inhibit-read-only t)
+              (headers (concat "Version: " erc-debug-irc-protocol-version "\n"
+                               "Emacs-Version: " emacs-version "\n"
+                               "\n"))
+              (msg (concat "This buffer displays all IRC protocol traffic "
+                           "exchanged with servers.\n"
+                           "Kill it to disable logging.\n"
+                           "Press `t' to toggle.\n")))
+          (insert headers (erc-make-notice msg)))
         (use-local-map (make-sparse-keymap))
         (local-set-key (kbd "t") 'erc-toggle-debug-irc-protocol))
       (add-hook 'kill-buffer-hook
                 (lambda () (setq erc-debug-irc-protocol nil))
                 nil 'local)
       (goto-char (point-max))
+      ;; Searchable phrase printed twice between logs and once before
+      ;; the first. This is a single line with CRLF endings.
       (let ((inhibit-read-only t))
-        (insert (erc-make-notice
-                 (format "IRC protocol logging %s at %s -- Press `t' to toggle logging.\n"
+        (insert (if erc-debug-irc-protocol "\r\n" "")
+                (erc-make-notice
+                 (format "IRC protocol logging %s at %s"
                          (if erc-debug-irc-protocol "disabled" "enabled")
-                         (current-time-string))))))
+                         (current-time-string)))
+                (if erc-debug-irc-protocol "\r\n" "\r\n\r\n"))))
     (setq erc-debug-irc-protocol (not erc-debug-irc-protocol))
     (if (and arg
              (not (get-buffer-window "*erc-protocol*" t)))
diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el
index d13397274a..5a362628fa 100644
--- a/test/lisp/erc/erc-tests.el
+++ b/test/lisp/erc/erc-tests.el
@@ -24,6 +24,7 @@
 (require 'ert)
 (require 'erc)
 (require 'erc-ring)
+(require 'erc-networks)
 
 (ert-deftest erc--read-time-period ()
   (cl-letf (((symbol-function 'read-string) (lambda (&rest _) "")))
@@ -109,3 +110,37 @@ erc-ring-previous-command
         (should (looking-at "abc")))))
   (when noninteractive
     (kill-buffer "*#fake*")))
+
+(ert-deftest erc-log-irc-protocol ()
+  (should-not erc-debug-irc-protocol)
+  (with-temp-buffer
+    (let (erc-server-announced-name
+          erc-network
+          (erc-server-process (start-process "fake" (current-buffer) "true"))
+          (erc-server-current-nick "tester")
+          (erc-session-server "myproxy.localhost")
+          (erc-session-port 6667)
+          (inhibit-message t))
+      (erc-toggle-debug-irc-protocol)
+      (erc-log-irc-protocol "PASS changeme\r\n" 'outgoing)
+      (setq erc-server-announced-name "irc.gnu.org")
+      (erc-log-irc-protocol ":irc.gnu.org 001 tester :Welcome")
+      (erc-log-irc-protocol ":irc.gnu.org 002 tester :Your host is irc.gnu.org")
+      (setq erc-network 'FooNet)
+      (erc-log-irc-protocol ":irc.gnu.org 422 tester :MOTD missing")
+      (setq erc-network 'BarNet)
+      (erc-log-irc-protocol ":irc.gnu.org 221 tester +i")))
+  (with-current-buffer "*erc-protocol*"
+    (goto-char (point-min))
+    (search-forward "myproxy.localhost:6667 >> PASS")
+    (forward-line)
+    (search-forward "irc.gnu.org << :irc.gnu.org 001")
+    (forward-line)
+    (search-forward "irc.gnu.org << :irc.gnu.org 002")
+    (forward-line)
+    (search-forward "FooNet << :irc.gnu.org 422")
+    (forward-line)
+    (search-forward "BarNet << :irc.gnu.org 221"))
+  (when noninteractive
+    (kill-buffer "*erc-protocol*")
+    (should-not erc-debug-irc-protocol)))
-- 
2.31.1


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50009; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 11 Aug 2021 14:26:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 11 10:26:38 2021
Received: from localhost ([127.0.0.1]:36249 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mDpBl-0006q4-Ue
	for submit <at> debbugs.gnu.org; Wed, 11 Aug 2021 10:26:38 -0400
Received: from lists.gnu.org ([209.51.188.17]:35466)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jp@HIDDEN>) id 1mDpBj-0006pu-CY
 for submit <at> debbugs.gnu.org; Wed, 11 Aug 2021 10:26:35 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:42468)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <jp@HIDDEN>) id 1mDpBj-0004lK-5Y
 for bug-gnu-emacs@HIDDEN; Wed, 11 Aug 2021 10:26:35 -0400
Received: from mail-108-mta254.mxroute.com ([136.175.108.254]:45585)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <jp@HIDDEN>) id 1mDpBg-0000kx-Mk
 for bug-gnu-emacs@HIDDEN; Wed, 11 Aug 2021 10:26:34 -0400
Received: from filter004.mxroute.com ([149.28.56.236] filter004.mxroute.com)
 (Authenticated sender: mN4UYu2MZsgR)
 by mail-108-mta254.mxroute.com (ZoneMTA) with ESMTPSA id
 17b359b851900074ba.001 for <bug-gnu-emacs@HIDDEN>
 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256);
 Wed, 11 Aug 2021 14:26:29 +0000
X-Zone-Loop: e39a0bb88a61f0df01addf14f636b025773cebec080f
X-Originating-IP: [149.28.56.236]
From: "J.P." <jp@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 28.0.50; add CRLF to outgoing ERC protocol logger lines
Date: Wed, 11 Aug 2021 07:26:26 -0700
Message-ID: <87v94chxbh.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-AuthUser: masked@HIDDEN
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, HAS_ATTACHMENT=0, FROM_EQ_ENVFROM=0,
 MIME_TRACE=0, MIME_GOOD=-0.1, RCPT_COUNT_ONE=0, MID_RHS_MATCH_FROM=0,
 RCVD_COUNT_ZERO=0, TO_DN_NONE=0]
Received-SPF: pass client-ip=136.175.108.254; envelope-from=jp@HIDDEN;
 helo=mail-108-mta254.mxroute.com
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H2=-0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

--=-=-=
Content-Type: text/plain

Tags: patch

Hi, this patch or similar would really make generating test data a lot
easier (please see the behavioral tests in these bugs [1] for examples).

If it were up to me, we'd also get rid of the interactive toggling, at
least while sessions are ongoing. The reason is that I find the most
interesting/important parts of a session to be the initial "connection
registration" phase and subsequent server burst (and possibly any
NickServ interactions and early JOIN activity that immediately follow).
But out of respect for tradition, I've left all of that alone. Thanks.


[1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=48598
    https://debbugs.gnu.org/cgi/bugreport.cgi?bug=49860


In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.17.4)
 of 2021-08-09 built on localhost
Repository revision: aeec97fae0ccfcc4dc406a5e0e4c0a94b834cac4
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Fedora 34 (Workstation Edition)

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS
X11 XDBE XIM XPM 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
  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 rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg 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
subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs
cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
iso-transl tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type 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 elisp-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 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 hashtable-print-readable backquote threads 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 51538 6355)
 (symbols 48 6607 1)
 (strings 32 18255 1368)
 (string-bytes 1 616656)
 (vectors 16 14292)
 (vector-slots 8 185252 10153)
 (floats 8 21 47)
 (intervals 56 205 0)
 (buffers 992 10))

--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Add-CRLF-to-outgoing-ERC-protocol-logger-lines.patch

From 871669a52a6a410f17e1d22960490a274cc36f54 Mon Sep 17 00:00:00 2001
From: "F. Jason Park" <jp@HIDDEN>
Date: Mon, 14 Jun 2021 22:24:01 -0700
Subject: [PATCH] Add CRLF to outgoing ERC protocol logger lines

* erc.el (erc-debug-irc-protocol): Previously, the newline handling
was disguising a subtle, semi-important bug in which phantom line
feeds were accidentally being sent to servers. Also, there was a
harmless but annoying mismatch between outgoing and incoming lines:
the latter lacked carriage returns. This adds them everywhere to make
machine parsing easier. This also makes room for the addition of a
session identifier, if one is ever introduced. When set, such a
variable would make logging more meaningful when multiple sessions
exist for the same network. Also added are timestamps to aid in
reproducing bugs. And outgoing lines are no longer propertized.
(erc-debug-irc-protocol-time-format): Add new variable to help
with reproducing bugs.
(erc-debug-irc-protocol-version): Add new variable to print atop
erc-protocol log files for tracking format used for logging.
(erc-toggle-debug-irc-protocol): Add headers to log buffer for
the benefit of bug-reproduction tools, so they can detect the
format used in a log. Clean up overlong lines.
---
 lisp/erc/erc.el | 74 ++++++++++++++++++++++++++++++++-----------------
 1 file changed, 48 insertions(+), 26 deletions(-)

diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 73202016ba..2eba4a900c 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -2312,6 +2312,14 @@ erc-error
 
 ;;; Debugging the protocol
 
+(defvar erc-debug-irc-protocol-time-format "%FT%T.%6N%z "
+  "An optional format string for optional I/O timestamps.")
+
+(defconst erc-debug-irc-protocol-version "1"
+  "Protocol log format version number.
+These logs are machine-readable, but external tools used in bug
+reproduction, etc. need a way to track changes to the format.")
+
 (defvar erc-debug-irc-protocol nil
   "If non-nil, log all IRC protocol traffic to the buffer \"*erc-protocol*\".
 
@@ -2333,32 +2341,36 @@ erc-log-irc-protocol
 
 The buffer is created if it doesn't exist.
 
-If OUTBOUND is non-nil, STRING is being sent to the IRC server
-and appears in face `erc-input-face' in the buffer."
+If OUTBOUND is non-nil, STRING is being sent to the IRC server and
+appears in face `erc-input-face' in the buffer.  Lines must already
+contain CRLF endings.  Peer is identified by the most precise label
+available at run time, starting with the network name, followed by the
+self-reported host name, and falling back to the dialed <server>:<port>.
+When capturing logs for multiple peers and sorting them into buckets,
+such inconsistent labeling may pose a problem during an initial server
+burst.  For now, the recommended approach is to wrap this function with
+advice that temporarily redefines the symbol-function `erc-network'."
   (when erc-debug-irc-protocol
-    (let ((network-name (or (ignore-errors (erc-network-name))
-                            "???")))
+    (let ((esid (or (and (fboundp 'erc-network)
+                         (erc-network)
+                         (erc-network-name))
+                    erc-server-announced-name
+                    (format "%s:%s" erc-session-server erc-session-port)))
+          (ts (when erc-debug-irc-protocol-time-format
+                (format-time-string erc-debug-irc-protocol-time-format))))
       (with-current-buffer (get-buffer-create "*erc-protocol*")
         (save-excursion
           (goto-char (point-max))
           (let ((inhibit-read-only t))
-            (insert (if (not outbound)
-                        ;; Cope with the fact that string might
-                        ;; contain multiple lines of text.
-                        (let ((lines (delete "" (split-string string
-                                                              "\n\\|\r\n")))
-                              (result ""))
-                          (dolist (line lines)
-                            (setq result (concat result network-name
-                                                 " << " line "\n")))
-                          result)
-                      (propertize
-                       (concat network-name " >> " string
-                               (if (/= ?\n
-                                       (aref string
-                                             (1- (length string))))
-                                   "\n"))
-                       'font-lock-face 'erc-input-face)))))
+            (insert (if outbound
+                        (concat ts esid " >> " string)
+                      ;; Cope with multi-line messages
+                      (let ((lines (split-string string "[\r\n]+" t))
+                            result)
+                        (dolist (line lines)
+                          (setq result (concat result ts esid
+                                               " << " line "\r\n")))
+                        result)))))
         (let ((orig-win (selected-window))
               (debug-buffer-window (get-buffer-window (current-buffer) t)))
           (when debug-buffer-window
@@ -2371,24 +2383,34 @@ erc-log-irc-protocol
 (defun erc-toggle-debug-irc-protocol (&optional arg)
   "Toggle the value of `erc-debug-irc-protocol'.
 
-If ARG is non-nil, show the *erc-protocol* buffer."
+If ARG is non-nil, show the *erc-protocol* buffer.  Everything before
+the first CRLF is front matter.  Everything before the first double
+linefeed is a header."
   (interactive "P")
   (let* ((buf (get-buffer-create "*erc-protocol*")))
     (with-current-buffer buf
       (view-mode-enter)
       (when (null (current-local-map))
-        (let ((inhibit-read-only t))
-          (insert (erc-make-notice "This buffer displays all IRC protocol traffic exchanged with each server.\n"))
-          (insert (erc-make-notice "Kill this buffer to terminate protocol logging.\n\n")))
+        (let ((inhibit-read-only t)
+              (headers (concat "Version: " erc-debug-irc-protocol-version "\n"
+                               "Emacs-Version: " emacs-version "\n"
+                               "\n"))
+              (msg (concat "This buffer displays all IRC protocol traffic "
+                           "exchanged with servers.\n"
+                           "Kill it to disable logging.\n"
+                           "Press `t' to toggle.\n")))
+          (insert headers (erc-make-notice msg)))
         (use-local-map (make-sparse-keymap))
         (local-set-key (kbd "t") 'erc-toggle-debug-irc-protocol))
       (add-hook 'kill-buffer-hook
                 (lambda () (setq erc-debug-irc-protocol nil))
                 nil 'local)
       (goto-char (point-max))
+      ;; Searchable phrase printed twice between logs and once before
+      ;; the first. This is a single line with CRLF endings.
       (let ((inhibit-read-only t))
         (insert (erc-make-notice
-                 (format "IRC protocol logging %s at %s -- Press `t' to toggle logging.\n"
+                 (format "IRC protocol logging %s at %s\r\n"
                          (if erc-debug-irc-protocol "disabled" "enabled")
                          (current-time-string))))))
     (setq erc-debug-irc-protocol (not erc-debug-irc-protocol))
-- 
2.31.1


--=-=-=--




Acknowledgement sent to "J.P." <jp@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#50009; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 16 Sep 2021 13:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.