unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 38011@debbugs.gnu.org
Subject: bug#38011: 27.0.50; [PATCH] WIP on allowing Gnus backends to return header data directly
Date: Sat, 26 Sep 2020 21:13:17 -0700	[thread overview]
Message-ID: <878scvluw2.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <87mu6t37c5.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 30 Apr 2020 06:50:34 +0200")

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Can someone explain what exactly this function is supposed to do?
>
> Somebody should have written more comments when they wrote that...  and,
> like, made it correct.
>
> It transforms this:
>
> 64007 Formatting labels used for URL buttons in Gnus articles Narendra
> Joshi <narendraj9@gmail.com> Sun, 19 Apr 2020 00:31:13 +0200
> <mailman.633.1587249088.3066.help-gnu-emacs@gnu.org>
> <87eesk2zpq.fsf@gmail.com> 3614 14 Xref:
> reader01.eternal-september.org gnu.emacs.help:57603
>
> Into this:
>
> 64007 Formatting labels used for URL buttons in Gnus articles Narendra
> Joshi <narendraj9@gmail.com> Sun, 19 Apr 2020 00:31:13 +0200
> <mailman.633.1587249088.3066.help-gnu-emacs@gnu.org>
> <87eesk2zpq.fsf@gmail.com> 3614 14 Xref: marnie gnu.emacs.help:57603
> 01.eternal-september.org
>
> Which is wrong, of course -- the "01.eternal-september.org" thing
> shouldn't be there.
>
> Anyway, what it's supposed to do it rewrite
>
> Xref: reader01.eternal-september.org foo.bar:2523 gnu.emacs.help:57603 zot.bar:3242
>
> to
>
> Xref: whatever gnu.emacs.help:57603 foo.bar:2523 zot.bar:3242
>
> That is, put the group/article we're really selecting first in the Xref
> header, but leave the remaining as they were.  This is because we need
> those to mark the article as read in those other groups, but we
> primarily need to know where this article really came from (the first
> entry).

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.

You say the existing xrefs should be left as they are, but the code adds
"prefix" to them. Should this be added unconditionally?

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)
		     " "))))





  reply	other threads:[~2020-09-27  4:13 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-31 21:34 bug#38011: 27.0.50; [PATCH] WIP on allowing Gnus backends to return header data directly Eric Abrahamsen
2019-11-01 14:12 ` Lars Ingebrigtsen
2019-11-01 18:41   ` Eric Abrahamsen
2019-11-01 20:52     ` Eric Abrahamsen
2019-11-02 14:49     ` Lars Ingebrigtsen
2019-11-07 23:21       ` Eric Abrahamsen
2019-11-08 21:03         ` Lars Ingebrigtsen
2019-11-08 21:43           ` Eric Abrahamsen
2019-11-08 21:58             ` Lars Ingebrigtsen
2020-03-29 19:50               ` Eric Abrahamsen
2020-04-30  4:50                 ` Lars Ingebrigtsen
2020-09-27  4:13                   ` Eric Abrahamsen [this message]
2020-09-27 12:16                     ` Lars Ingebrigtsen
2020-09-27 23:41                       ` Eric Abrahamsen
2021-01-02  3:18                         ` Eric Abrahamsen
2021-01-02  5:59                           ` Lars Ingebrigtsen
2021-01-02 20:49                             ` Eric Abrahamsen
2021-01-03  7:45                               ` Lars Ingebrigtsen
2021-01-03 19:53                                 ` Eric Abrahamsen
2021-01-04  9:05                                   ` Lars Ingebrigtsen
2021-01-04 18:09                                     ` Eric Abrahamsen
2021-01-05  8:47                                       ` Lars Ingebrigtsen
2021-01-05 17:02                                         ` Eric Abrahamsen
2021-01-17  5:00                                           ` Eric Abrahamsen
2021-01-18 10:48                                             ` Robert Pluim
2021-01-18 21:12                                               ` Eric Abrahamsen
2021-01-18 16:37                                             ` Lars Ingebrigtsen
2021-01-03 19:54                                 ` Eric Abrahamsen
2021-01-03 21:38                                   ` Eric Abrahamsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878scvluw2.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=38011@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).