Gnus development mailing list
 help / color / mirror / Atom feed
From: Reiner Steib <4uce.02.r.steib@gmx.net>
Subject: Re: [Patch] MFT in mml-preview
Date: Mon, 30 Dec 2002 23:04:34 +0100	[thread overview]
Message-ID: <v9ptrjupsd.fsf@theotp5.physik.uni-ulm.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 323 bytes --]

On Mon, Dec 30 2002, Lars Magne Ingebrigtsen wrote:

> Reiner Steib <4uce.02.r.steib@gmx.net> writes:
>
>> ...and we could use "(message-subscribed-FOO-p)" in both, mml.el and
>> message.el.  Does this make sense?
>
> Yup.

Okay, here's a new patch using `message-subscribed-p' (maybe the
doc-string should be improved?):


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: message.mml-preview-insert-mft-02.patch --]
[-- Type: text/x-patch, Size: 2035 bytes --]

*** mml.el.~6.65.~	Mon Dec 30 17:25:32 2002
--- mml.el	Mon Dec 30 21:50:17 2002
***************
*** 1007,1012 ****
--- 1007,1022 ----
    (mml-insert-tag 'part 'type type 'disposition "inline")
    (forward-line -1))
  
+ (defun mml-preview-insert-mft ()
+   "Insert a Mail-Followup-To header before previewing an article.
+ Should be adopted if code in `message-send-mail' is changed."
+   (when (and (message-mail-p)
+ 	     (message-subscribed-p)
+ 	     (not (mail-fetch-field "mail-followup-to"))
+ 	     (message-make-mft))
+     (message-position-on-field "Mail-Followup-To" "X-Draft-From")
+     (insert (message-make-mft))))
+ 
  (defun mml-preview (&optional raw)
    "Display current buffer with Gnus, in a new buffer.
  If RAW, don't highlight the article."
***************
*** 1027,1032 ****
--- 1037,1043 ----
  				   "*MIME preview of ") (buffer-name))))
        (erase-buffer)
        (insert-buffer buf)
+       (mml-preview-insert-mft)
        (let ((message-deletable-headers (if (message-news-p)
  					   nil
  					 message-deletable-headers)))

--- message.el.~6.268.~	Mon Dec 30 21:28:50 2002
+++ message.el	Mon Dec 30 21:51:56 2002
@@ -1896,6 +1896,13 @@
 		   (message-fetch-field "cc")
 		   (message-fetch-field "bcc")))))))
 
+(defun message-subscribed-p ()
+  "Say whether we need to insert a MFT header."
+  (or message-subscribed-regexps
+      message-subscribed-addresses
+      message-subscribed-address-file
+      message-subscribed-address-functions))
+
 (defun message-next-header ()
   "Go to the beginning of the next header."
   (beginning-of-line)
@@ -3343,10 +3350,7 @@
     (save-restriction
       (message-narrow-to-headers)
       ;; Generate the Mail-Followup-To header if the header is not there...
-      (if (and (or message-subscribed-regexps
-		   message-subscribed-addresses
-		   message-subscribed-address-file
-		   message-subscribed-address-functions)
+      (if (and (message-subscribed-p)
 	       (not (mail-fetch-field "mail-followup-to")))
 	  (setq headers
 		(cons

[-- Attachment #3: Type: text/plain, Size: 455 bytes --]


--8<---------------cut here---------------start------------->8---
2002-12-30  Reiner Steib  <Reiner.Steib@gmx.de>

	* message.el (message-subscribed-p): New function.
	(message-send-mail): Use it.
	* mml.el (mml-preview-insert-mft): New function.
	(mml-preview): Use it.

--8<---------------cut here---------------end--------------->8---

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/

             reply	other threads:[~2002-12-30 22:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-30 22:04 Reiner Steib [this message]
2002-12-30 22:24 ` Lars Magne Ingebrigtsen
  -- strict thread matches above, loose matches on Subject: below --
2002-12-30 18:59 Reiner Steib
2002-12-30 19:14 ` Lars Magne Ingebrigtsen
2002-12-30 19:54   ` Reiner Steib
2002-12-30 20:21     ` Lars Magne Ingebrigtsen

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=v9ptrjupsd.fsf@theotp5.physik.uni-ulm.de \
    --to=4uce.02.r.steib@gmx.net \
    --cc=reiner.steib@gmx.de \
    /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).