From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/12852 Path: main.gmane.org!not-for-mail From: Steinar Bang Newsgroups: gmane.emacs.gnus.general Subject: making gnus-summary-reparent-thread work right with nnml Date: 18 Nov 1997 17:13:56 +0100 Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 (generated by tm-edit 7.105) Content-Type: text/plain; charset=US-ASCII X-Trace: main.gmane.org 1035152317 6035 80.91.224.250 (20 Oct 2002 22:18:37 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 22:18:37 +0000 (UTC) Return-Path: Original-Received: from xemacs.org (xemacs.cs.uiuc.edu [128.174.252.16]) by altair.xemacs.org (8.8.8/8.8.8) with ESMTP id KAA06421 for ; Tue, 18 Nov 1997 10:06:11 -0800 Original-Received: from ifi.uio.no (ifi.uio.no [129.240.64.2]) by xemacs.org (8.8.5/8.8.5) with ESMTP id MAA08371 for ; Tue, 18 Nov 1997 12:06:26 -0600 (CST) Original-Received: from claymore.vcinet.com (claymore.vcinet.com [208.205.12.23]) by ifi.uio.no (8.8.7/8.8.7/ifi0.2) with SMTP id RAA10374 for ; Tue, 18 Nov 1997 17:18:40 +0100 (MET) Original-Received: (qmail 23869 invoked by uid 504); 18 Nov 1997 16:18:38 -0000 Original-Received: (qmail 23866 invoked from network); 18 Nov 1997 16:18:35 -0000 Original-Received: from abel.metis.no (HELO gw.metis.no) (193.90.64.1) by claymore.vcinet.com with SMTP; 18 Nov 1997 16:18:33 -0000 Original-Received: by gw.metis.no (8.8.6/8.8.6) with ESMTP id RAA07384; Tue, 18 Nov 1997 17:17:58 +0100 (MET) Original-Received: by metis.no (8.8.6/8.8.6) with ESMTP id RAA18019; Tue, 18 Nov 1997 17:17:54 +0100 (MET) Original-Received: by norne.troll.no (8.8.4/8.8.4) id RAA27575; Tue, 18 Nov 1997 17:13:56 +0100 (MET) Original-To: ding@gnus.org Original-Lines: 76 X-Mailer: Gnus v5.5/Emacs 19.34 Xref: main.gmane.org gmane.emacs.gnus.general:12852 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:12852 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))))) ...