Gnus development mailing list
 help / color / mirror / Atom feed
From: Steinar Bang <sb@metis.no>
Subject: making gnus-summary-reparent-thread work right with nnml
Date: 18 Nov 1997 17:13:56 +0100	[thread overview]
Message-ID: <whhg9anprv.fsf@norne.troll.no> (raw)

Platform: Emacs 19.34, gnus-5.4.67 with nnml backend, SPARC, Solaris 2.5

I've never gotten gnus-summary-reparent-thread to work right.  If I
insert a References: header or edit an existing References: header
manually with gnus-summary-edit-article, it is immediately rethreaded
when I do a C-c C-c.

If I use gnus-summary-reparent-thread, I don't see the new References:
header when I toggle all headers with the "t" command, if the message
had no References: header to begin with (this is the part I don't know
how to make work).  Also "Fetch parent" doesn't work for these
articles. 

If the article already has a References header, the new article number
is inserted at the start (looking at the code at the end of this
message), and I belive it should be inserted at the end...? (at least
that's the way I understand 2.2.5 of RFC 1036...)  One way to make
this work, would be to strip away the earlier contents of the
References: header, before inserting the message-id of the new parent.

Anyways, if someone could come up with ideas of how to fix this for an
emacs lisp semi literate, I would be thankful (I'm tired of hand
editing Eudora, Outlook and MSExchange messages).

Thanx!


- Steinar

code from lisp/gnus-sum.el:
...
(defun gnus-summary-reparent-thread ()
  "Make the current article child of the marked (or previous) article.

Note that the re-threading will only work if `gnus-thread-ignore-subject'
is non-nil or the Subject: of both articles are the same."
  (interactive)
  (unless (not (gnus-group-read-only-p))
    (error "The current newsgroup does not support article editing"))
  (unless (<= (length gnus-newsgroup-processable) 1)
    (error "No more than one article may be marked"))
  (save-window-excursion
    (let ((gnus-article-buffer " *reparent*")
	  (current-article (gnus-summary-article-number))
	  ;; First grab the marked article, otherwise one line up.
	  (parent-article (if (not (null gnus-newsgroup-processable))
			      (car gnus-newsgroup-processable)
			    (save-excursion
			      (if (eq (forward-line -1) 0)
				  (gnus-summary-article-number)
				(error "Beginning of summary buffer"))))))
      (unless (not (eq current-article parent-article))
	(error "An article may not be self-referential"))
      (let ((message-id (mail-header-id
			 (gnus-summary-article-header parent-article))))
	(unless (and message-id (not (equal message-id "")))
	  (error "No message-id in desired parent"))
	(gnus-summary-select-article t t nil current-article)
	(set-buffer gnus-original-article-buffer)
	(let ((buf (format "%s" (buffer-string))))
	  (nnheader-temp-write nil
	    (insert buf)
	    (goto-char (point-min))
	    (if (search-forward-regexp "^References: " nil t)
		(insert message-id " " )
	      (insert "References: " message-id "\n"))
	    (unless (gnus-request-replace-article
		     current-article (car gnus-article-current)
		     (current-buffer))
	      (error "Couldn't replace article"))))
	(set-buffer gnus-summary-buffer)
	(gnus-summary-unmark-all-processable)
	(gnus-summary-rethread-current)
	(gnus-message 3 "Article %d is now the child of article %d"
		      current-article parent-article)))))
...


             reply	other threads:[~1997-11-18 16:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-11-18 16:13 Steinar Bang [this message]
1997-11-19  9:14 ` Steinar Bang
1997-10-24 21:01   ` automagicly compressed nnml files St. Suika Roberts
1997-10-24 23:39     ` Lars Magne Ingebrigtsen
1997-10-26 15:39       ` Simon Josefsson
1997-10-27 11:22         ` Simon Josefsson
1997-10-29  5:09       ` David Hedbor
1997-11-05 12:50         ` Lars Magne Ingebrigtsen
1997-11-06 23:37           ` David Hedbor
1997-11-13 21:14             ` Lars Magne Ingebrigtsen
1997-11-18 23:14               ` David Hedbor
1997-11-23  6:08                 ` Lars Magne Ingebrigtsen
1997-11-23  6:08 ` making gnus-summary-reparent-thread work right with nnml Lars Magne Ingebrigtsen
1997-11-24 13:53   ` Steinar Bang

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

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

  git send-email \
    --in-reply-to=whhg9anprv.fsf@norne.troll.no \
    --to=sb@metis.no \
    /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.
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 NNTP newsgroup(s).