From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/4521 Path: main.gmane.org!not-for-mail From: craffert@sps.ml.com (Colin Rafferty) Newsgroups: gmane.emacs.gnus.general Subject: Re: Mail Groups and Thread suggestion/question Date: Tue, 19 Dec 95 18:57:13 EST Message-ID: <9512192357.AA10756@sparc10.sps.ml.com> References: <199511291654.LAA05487@hera.wscis.wsc.com> <9511292259.AA12703@sparc10.sps.ml.com> <199511301021.LAA19443@ssv4.dina.kvl.dk> Reply-To: Colin Rafferty NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035145257 29923 80.91.224.250 (20 Oct 2002 20:20:57 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 20:20:57 +0000 (UTC) Return-Path: ding-request@ifi.uio.no Original-Received: from ifi.uio.no (ifi.uio.no [129.240.64.2]) by miranova.com (8.6.11/8.6.9) with ESMTP id QAA09185 for ; Tue, 19 Dec 1995 16:22:51 -0800 Original-Received: from njmlfire.ml.com (njmlfire.ml.com [198.242.49.1]) by ifi.uio.no with ESMTP (8.6.11/ifi2.4) id for ; Wed, 20 Dec 1995 00:57:49 +0100 Original-Received: from commpost.ml.com ([146.125.4.24]) by njmlfire.ml.com (8.6.12/8.6.12) with ESMTP id SAA24523 for ; Tue, 19 Dec 1995 18:57:14 -0500 Original-Received: from sparc10.sps.ml.com (sparc10.sps.ml.com [192.168.111.24]) by commpost.ml.com (8.6.12/8.6.12) with SMTP id SAA14599 for ; Tue, 19 Dec 1995 18:58:12 -0500 Original-Received: from spssunp.masdev.ml.com by sparc10.sps.ml.com (4.1/SMI-4.1) id AA10756; Tue, 19 Dec 95 18:57:13 EST Original-Received: by spssunp.masdev.ml.com (4.1/SMI-4.1) id AA07925; Tue, 19 Dec 95 18:57:13 EST Original-To: (ding) GNUS Mailing List In-Reply-To: larsi@ifi.uio.no's message of 01 Dec 1995 04:57:28 +0100 X-Face: ""xJff%{>hr-{:QXl"Xk2O@@(+F]e{"%EYQiW@mUuvEsL>=mx96j12qW[%m;|:B^n{J8k?Mz[K1_+H;$v,nYx^1o_=4M,L+]FIU~[[`-w~~xsy-BX,?tAF_.8u&0y*@aCv;a}Y'{w@#*@iwAl?oZpvvv X-Y-Zippy: I'm having a BIG BANG THEORY!! Xref: main.gmane.org gmane.emacs.gnus.general:4521 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:4521 Lars Magne Ingebrigtsen writes: > Per Abrahamsen writes: >> Colin Rafferty writes: >>> Jason Schroeder writes: >>>> While using mail groups, is there a way to come across an article and add >>>> it to another thread permanently? >>> There are a bunch of really stupid mailers out there that don't know >>> about "References:". How many years has it been? I have been having >>> the same problems. >>> (defun gnus-summary-adopt-parent-thread (&optional which) >>> "Make current article child of the previous one. >>> With prefix arg, parent is that many articles previous." >> Well, instead of a prefix argument, I think it would be better to use >> the process mark. > Yup, that's a good idea. If somebody wants to write the function and > submit a patch, I'll apply the patch. Ain't I helpful? :-) I would like to thank Jason Schroeder for the kick in the ass to get me started on this code. I would also like to thank Per Abrahamsen for pointing out using the process-mark: "Counting lines is something you do in vi, not Emacs." Anyway, here is gnus-summary-reparent-thread.el (bound to T ^). It does not change the threading pattern during the group visit, and it will mark the child article as read. I have not been hacking Gnus since last year, so I don't know all the correct functions. Here it is: (require 'gnus) (provide 'gnus-reparent) (define-key gnus-summary-thread-map "^" 'gnus-summary-reparent-thread) (defun gnus-summary-reparent-thread () "Make 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. The change will not be visible until the next group retrieval." (interactive) (or (not (gnus-group-read-only-p)) (error "The current newsgroup does not support article editing.")) (or (<= (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.")))))) (or (not (eq current-article parent-article)) (error "An article may not be self-referential.")) (let ((message-id (mail-header-id (gnus-get-header-by-num parent-article)))) (or (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-article-buffer) (setq buffer-read-only nil) (let ((buf (buffer-substring-no-properties (point-min) (point-max)))) (erase-buffer) (insert buf)) (goto-char (point-min)) (if (search-forward-regexp "^References: " nil t) (insert message-id " " ) (insert "References: " message-id "\n")) (or (gnus-request-replace-article current-article (car gnus-article-current) gnus-article-buffer) (error "Couldn't replace article.")) (set-buffer gnus-summary-buffer) (gnus-summary-unmark-all-processable) (message "Article %d is now the child of article %d." current-article parent-article) )))) ; Colin