From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#38011: 27.0.50; [PATCH] WIP on allowing Gnus backends to return header data directly Date: Sun, 27 Sep 2020 14:16:16 +0200 Message-ID: <87a6xb5sa7.fsf@gnus.org> References: <87y2x0a9bl.fsf@ericabrahamsen.net> <87a79f3cu3.fsf@gnus.org> <8736f7l9rd.fsf@ericabrahamsen.net> <87eeyqfi4u.fsf@gnus.org> <87mud75l3i.fsf@ericabrahamsen.net> <87k18a3wtc.fsf@gnus.org> <871ruiqc19.fsf@ericabrahamsen.net> <87imnu2foy.fsf@gnus.org> <87tv27rlcz.fsf@ericabrahamsen.net> <87mu6t37c5.fsf@gnus.org> <878scvluw2.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27272"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 38011@debbugs.gnu.org To: Eric Abrahamsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 27 14:18:08 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kMVd1-0006z5-RX for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 27 Sep 2020 14:18:07 +0200 Original-Received: from localhost ([::1]:52180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMVd0-0001hB-PZ for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 27 Sep 2020 08:18:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52762) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMVby-0000gd-8e for bug-gnu-emacs@gnu.org; Sun, 27 Sep 2020 08:17:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37016) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kMVbx-0006hd-Un for bug-gnu-emacs@gnu.org; Sun, 27 Sep 2020 08:17:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kMVbx-0003qQ-OP for bug-gnu-emacs@gnu.org; Sun, 27 Sep 2020 08:17:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Sep 2020 12:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38011 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 38011-submit@debbugs.gnu.org id=B38011.160120899414732 (code B ref 38011); Sun, 27 Sep 2020 12:17:01 +0000 Original-Received: (at 38011) by debbugs.gnu.org; 27 Sep 2020 12:16:34 +0000 Original-Received: from localhost ([127.0.0.1]:48562 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMVbQ-0003pT-Gn for submit@debbugs.gnu.org; Sun, 27 Sep 2020 08:16:34 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:36592) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMVbO-0003pF-43 for 38011@debbugs.gnu.org; Sun, 27 Sep 2020 08:16:27 -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=lLnd++OVAX5BtPHLA3vYUR59Y47O5yzB4x7tZC74SK8=; b=rYV4vJyzBh059q7Yq7MKNXaaSZ /Q47hRNy3q5ih3kP9BrVcO4FzJQ1scCFQWOpWZIOpoRXjmKAtf6HloWDYApshTsNHNQn47rNlWJ8W PuVPcR94MmBHblOs+/NIBe8LhoV5vjuw5auqucBKReT9dILbNTUOHMXnbtfpgs8iQ184=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kMVbF-0003pj-D7; Sun, 27 Sep 2020 14:16:20 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEW8xch5hIdBPkP/ //9qUcmpAAAAAWJLR0QDEQxM8gAAAAd0SU1FB+QJGwsjOr/5AOkAAAGZSURBVCjPTZGxbpxAEIYH K4dsqiQykXyVC1c8xRLlkNw5EoPMdJEOC/YpOCmVq3N0XEF1iliL/Z8ys/gSZ4vVfszwz/wzlDJc Z2ExEVFaie8Aa/cBBL7WiKMAdvQsf0FG/2ghJSNEgLZGvLEBAPhBVqndEmXw1h1HZvQB5ngYxIcs suKObrDgWeFoX+EqOB+KTn2TsWpgo+B6VnFgmxqi5/4CAoyOH4jiXeK7H4DhUouaZJ6+Z3jhR6LX XXHYplI5qYm0lb2ayt12VBCrfSTk756I4KxqXpK/+UW0bjITfCHZqRpf6zOufPhy8y3cq2qKqKS0 jDRt1WjT15rGCjEUPmikNmRi/Fym00q5onhzuI2CGjdlFN+f2o8BxO2Lkfdyv0Chv3AuwULXtZcF DnSlAmsMpwaoTEVhbpI7eDYXWi5zV4kbxFCkTmzRr4+1dqFlqH3qk2c2iw36MicYOX+DbNK1HeJ+ AfyGTx8+lW+gc2bO2bwD/4vMm/9gqrw9w4DTZ1g+g7x8ha5vqYNiKMK2aLFwbiWcBO/vP9bos2ts 4KKOAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIwLTA5LTI3VDExOjM1OjU3KzAwOjAwSQ82wQAAACV0 RVh0ZGF0ZTptb2RpZnkAMjAyMC0wOS0yN1QxMTozNTo1NyswMDowMDhSjn0AAAAASUVORK5CYII= X-Now-Playing: LCD Soundsystem's _London Sessions_: "Pow Pow" In-Reply-To: <878scvluw2.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Sat, 26 Sep 2020 21:13:17 -0700") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:189119 Archived-At: Eric Abrahamsen writes: >> Xref: reader01.eternal-september.org foo.bar:2523 gnu.emacs.help:57603 zot.bar:3242 [...] > Slowly, slowly, I'm getting this done. I'm still a bit confused here, > though. The xref elements look like they're not supposed to have spaces > in them, but the existing code does this: > > (insert "Xref: " sysname " " group ":") > (princ article (current-buffer)) > > Which leaves a space between sysname and group. I'm not quite sure I understand the question? The sysname is just a part of the syntax of the Xref header and isn't used for anything by Gnus, as far as I know. So there has to be a space? It's certainly not part of the group name. > You say the existing xrefs should be left as they are, but the code adds > "prefix" to them. Should this be added unconditionally? Uhm... I think so? But I'm not sure. > Here's the new version of the function, operating on a header struct. > Does this look right to you? > > Thanks, > Eric > > (defun nnvirtual-update-xref-header (header group prefix sysname) > "Add xref to component GROUP to HEADER. > Also add a server PREFIX any existing xref lines." > (let ((bits (split-string (mail-header-xref header) > nil t "[[:blank:]]")) > (art-no (mail-header-number header))) > (setq bits > (mapcar (lambda (bit) > (concat prefix bit)) > bits)) > (setf (mail-header-xref header) > (mapconcat #'identity > (cons (format "%s %s:%d" > sysname group art-no) > bits) > " ")))) I think so. The body of the let form is perhaps more easily expressed as (setf (mail-header-xref header) (concat (format "%s %s:%d " sysname group art-no) (mapconcat (lambda (bit) (concat prefix bit)) bits " "))) ? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no