From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:1004:224b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12.migadu.com with LMTPS id oJSjMU4ChGTQAwEATFOONw (envelope-from ) for ; Sat, 10 Jun 2023 06:55:42 +0200 Received: from mta0.migadu.com ([2001:41d0:1004:224b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id yEasME4ChGSR2gAAG6o9tA (envelope-from ) for ; Sat, 10 Jun 2023 06:55:42 +0200 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1686372942; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to; bh=MjJp0rIqpBixGdluFasyt4tq88o3TI0CKOxs+OM1kdo=; b=IudVvirfG7wUSAIOm9Os4YjtoPuoW8uNap52WlIb9jDpUm/DcTscOQDwZPCjkZCi0u7mpR FoXVnsSLsKeBb0/ihjQBjnBaY/CZCxeTjmxcTVaVybuSlwoiVftq/t/d17By/8zN8vvEXZ slQbvvMiJTG4LpLHf8y5/wDnAtuPYlowWA9GSi129jv2s1U1J8AuTHL4O1Mvh/E1LcDMYp C9cRFWuw9RGA9O6TM2G94e4xrRBkThPYc1HRGCaS/jXTIX7CyBKGgqW06Gf7GVCPbHK8UR eN3E36OF2jmmI8Ta9NRsPYfPpvNcV6yHF2eDyfIybYSUf6rdfygtZyk4/Ovagw== From: Kyle Meyer To: jlicht@fsfe.org Cc: piem@inbox.kyleam.com Subject: Re: [PATCH v2 2/5] gnus: Skip adding mboxrd from-line when not needed. In-Reply-To: <20230609124829.29629-3-jlicht@fsfe.org> Date: Sat, 10 Jun 2023 00:55:41 -0400 Message-ID: <87ttvfncfm.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-TUID: xQc50UQm/n5O jlicht@fsfe.org writes: > From: Jelle Licht Could you add a bit about why this is needed? Basically that, at least over NNTP, gnus-summary-display-article shows a plain message, but when debbugs.el visits an issues message with Gnus, it's already in mbox format. It'd also be nice to add a link to the relevant inbox.kyleam.com thread. (Convention nit-pick for this and subsequent patches: please drop the period from the subject, ignoring all Guix muscle memory :>) > +(defun piem-gnus--from-line (buffer) > + "Returns a cons of the first line of BUFFER, if it is an > +mbboxrd from-line (or nil if none), and the remaining lines of typo: s/mbboxrd/mboxrd/ > +BUFFER." To follow Elisp docstring conventions, could you rewrite this so that the first line is self-contained sentence? It's marked as internal, so not too important, but I wonder if something like "piem-gnus--split-message" might give a better hint at what it does. > + (with-current-buffer buffer > + (let ((start (point-min)) > + (end (point-max))) > + (goto-char start) > + (let* ((eol (line-end-position)) > + (line (buffer-substring-no-properties start eol))) > + (if (string-match-p "^From " line) > + (cons line (buffer-substring-no-properties (+ eol 1) end)) > + (cons nil (buffer-substring-no-properties start end))))))) Looks fine to me. And I don't think we need to worry about save-excursion here, given that we're triggering the display of these buffers and, in general, this command is making lots of user-visible changes to the layout anyway (and we didn't know a way to avoid that: <87turabsb0.fsf@yoctocell.xyz>).