Gnus development mailing list
 help / color / mirror / Atom feed
* [patch] RFC2646, MIME format=flowed support
@ 2000-02-17 16:50 Simon Josefsson
  2000-02-24 16:56 ` Per Abrahamsen
  0 siblings, 1 reply; 13+ messages in thread
From: Simon Josefsson @ 2000-02-17 16:50 UTC (permalink / raw)


I've been sitting on this for a while, 
somewhat hesitant about simply committing 
it in case that it explodes. Please try 
it out to see if it works (or not).

Anyway, put

http://www.pdc.kth.se/~jas/fill-flowed.el

in your load-path and apply the patch 
below and your Gnus should recognize 
the wonders of RFC2646.

For entertainment, I manually 
encoded this article 
according to RFC2646.

Suggestions welcome, if someone want to 
rewrite the whole function into readable 
elisp I'd be very happy. :-)

Index: lisp/mm-view.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/mm-view.el,v
retrieving revision 5.40
diff -w -u -r5.40 mm-view.el
--- lisp/mm-view.el     1999/12/12 17:33:18     5.40
+++ lisp/mm-view.el     2000/02/17 16:37:24
@@ -136,6 +136,14 @@
            (charset (mail-content-type-get
                      (mm-handle-type handle) 'charset)))
        (insert (mm-decode-string text charset))
+       (when (and (equal type "plain")
+                  (equal (cdr (assoc 'format (mm-handle-type handle)))
+                         "flowed"))
+         (save-restriction
+           (narrow-to-region b (point))
+           (goto-char b)
+           (fill-flowed)
+           (goto-char (point-max))))
        (save-restriction
          (narrow-to-region b (point))
          (set-text-properties (point-min) (point-max) nil)




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch] RFC2646, MIME format=flowed support
  2000-02-17 16:50 [patch] RFC2646, MIME format=flowed support Simon Josefsson
@ 2000-02-24 16:56 ` Per Abrahamsen
  2000-03-11 21:47   ` Simon Josefsson
  0 siblings, 1 reply; 13+ messages in thread
From: Per Abrahamsen @ 2000-02-24 16:56 UTC (permalink / raw)


Simon Josefsson <jas@pdc.kth.se> writes:

> Suggestions welcome, if someone want to 
> rewrite the whole function into readable 
> elisp I'd be very happy. :-)

The Lisp looks fine.  However, the patch didn't apply cleanly, your
message isn't formatted differently after applying the patch, and
compiling fill-flowed.el with Emacs 20.4 gave these errors:

While compiling the end of the data in file /home/user_5/abraham/emacs/gnus/lisp/fill-flowed.el:
  ** The following functions are not known to be defined: point-at-bol,
    point-at-eol
Wrote /home/user_5/abraham/emacs/gnus/lisp/fill-flowed.elc



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch] RFC2646, MIME format=flowed support
  2000-02-24 16:56 ` Per Abrahamsen
@ 2000-03-11 21:47   ` Simon Josefsson
  2000-03-15  8:57     ` Per Abrahamsen
  0 siblings, 1 reply; 13+ messages in thread
From: Simon Josefsson @ 2000-03-11 21:47 UTC (permalink / raw)


Per Abrahamsen <abraham@dina.kvl.dk> writes:

> However, the patch didn't apply cleanly, your message isn't
> formatted differently after applying the patch, and compiling
> fill-flowed.el with Emacs 20.4 gave these errors:

I forgot part of the patch, sorry. 
Try this patch instead.  The 
compile error is fixed in the current 
version, <URL:http://www.pdc.kth.se/~jas/fill-flowed.el>.

(This message should be rfc2646-encoded.)

2000-03-11  Simon Josefsson  <jas@pdc.kth.se>

	* mm-decode.el (mm-dissect-singlepart): Create a MIME handle for
	text/plain parts with `format' parameters.

	* mm-view.el (autoload): Autoload fill-flowed.
	(mm-inline-text): For "plain" parts with a format=flowed
	parameter, call `fill-flowed'.

Index: lisp/mm-view.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/mm-view.el,v
retrieving revision 5.40
diff -w -u -r5.40 mm-view.el
--- lisp/mm-view.el	1999/12/12 17:33:18	5.40
+++ lisp/mm-view.el	2000/03/11 21:35:15
@@ -33,6 +33,7 @@
   (autoload 'gnus-article-prepare-display "gnus-art")
   (autoload 'vcard-parse-string "vcard")
   (autoload 'vcard-format-string "vcard")
+  (autoload 'fill-flowed "fill-flowed")
   (autoload 'diff-mode "diff-mode"))
 
 ;;;
@@ -136,6 +137,14 @@
 	    (charset (mail-content-type-get
 		      (mm-handle-type handle) 'charset)))
 	(insert (mm-decode-string text charset))
+	(when (and (equal type "plain")
+		   (equal (cdr (assoc 'format (mm-handle-type handle)))
+			  "flowed"))
+	  (save-restriction
+	    (narrow-to-region b (point))
+	    (goto-char b)
+	    (fill-flowed)
+	    (goto-char (point-max))))
 	(save-restriction
 	  (narrow-to-region b (point))
 	  (set-text-properties (point-min) (point-max) nil)
Index: lisp/mm-decode.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/mm-decode.el,v
retrieving revision 5.71
diff -w -u -r5.71 mm-decode.el
--- lisp/mm-decode.el	2000/03/07 14:28:55	5.71
+++ lisp/mm-decode.el	2000/03/11 21:35:15
@@ -257,7 +257,9 @@
 
 (defun mm-dissect-singlepart (ctl cte &optional force cdl description id)
   (when (or force
-	    (not (equal "text/plain" (car ctl))))
+	    (if (equal "text/plain" (car ctl))
+		(assoc 'format ctl)
+	      t))
     (let ((res (mm-make-handle
 		(mm-copy-to-buffer) ctl cte nil cdl description nil id)))
       (push (car res) mm-dissection-list)



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch] RFC2646, MIME format=flowed support
  2000-03-11 21:47   ` Simon Josefsson
@ 2000-03-15  8:57     ` Per Abrahamsen
  2000-03-15  9:05       ` Hrvoje Niksic
  2000-03-26 21:48       ` Simon Josefsson
  0 siblings, 2 replies; 13+ messages in thread
From: Per Abrahamsen @ 2000-03-15  8:57 UTC (permalink / raw)


Simon Josefsson <jas@pdc.kth.se> writes:

> I forgot part of the patch, sorry. Try this patch instead.  The
> compile error is fixed in the current version,
> <URL:http://www.pdc.kth.se/~jas/fill-flowed.el>.

Yes!  It works now.  I think you should commit it.

But maybe fill-flowed.el should be named rfc2646.el, to better match
the other file names in Gnus?



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch] RFC2646, MIME format=flowed support
  2000-03-15  8:57     ` Per Abrahamsen
@ 2000-03-15  9:05       ` Hrvoje Niksic
  2000-03-15 12:39         ` Eric S. Johansson
  2000-03-15 13:39         ` Andi Hechtbauer
  2000-03-26 21:48       ` Simon Josefsson
  1 sibling, 2 replies; 13+ messages in thread
From: Hrvoje Niksic @ 2000-03-15  9:05 UTC (permalink / raw)


Per Abrahamsen <abraham@dina.kvl.dk> writes:

> But maybe fill-flowed.el should be named rfc2646.el, to better match
> the other file names in Gnus?

I think it's lame to call elisp files after RFCs.  RFCs grow old,
wither and die.  Elisp is forever.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch] RFC2646, MIME format=flowed support
  2000-03-15  9:05       ` Hrvoje Niksic
@ 2000-03-15 12:39         ` Eric S. Johansson
  2000-03-15 13:39         ` Andi Hechtbauer
  1 sibling, 0 replies; 13+ messages in thread
From: Eric S. Johansson @ 2000-03-15 12:39 UTC (permalink / raw)



-----Original Message -----
From: "Hrvoje Niksic" <hniksic@iskon.hr>
> Elisp is forever.

no, not really.   It just seems that way when the code doesn't doesn't
work...




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch] RFC2646, MIME format=flowed support
  2000-03-15  9:05       ` Hrvoje Niksic
  2000-03-15 12:39         ` Eric S. Johansson
@ 2000-03-15 13:39         ` Andi Hechtbauer
  1 sibling, 0 replies; 13+ messages in thread
From: Andi Hechtbauer @ 2000-03-15 13:39 UTC (permalink / raw)
  Cc: ding, cadellin

Hrvoje Niksic <hniksic@iskon.hr> writes:

> Per Abrahamsen <abraham@dina.kvl.dk> writes:
> 
> > But maybe fill-flowed.el should be named rfc2646.el, to better match
> > the other file names in Gnus?
> 
> I think it's lame to call elisp files after RFCs.  RFCs grow old,
> wither and die.  Elisp is forever.

Somehow I think this one might make a great .signature

*lol*

-- 
Andi Hechtbauer                                           anti@spin.de 
System Administration                         voice: +49 941 94 65 937
SPiN GmbH               http://www.spin.de/     fax: +49 941 94 65 938  
------- web design - java chats - guestbooks - java/cgi coding -------



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch] RFC2646, MIME format=flowed support
  2000-03-15  8:57     ` Per Abrahamsen
  2000-03-15  9:05       ` Hrvoje Niksic
@ 2000-03-26 21:48       ` Simon Josefsson
  2000-04-20 21:07         ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 13+ messages in thread
From: Simon Josefsson @ 2000-03-26 21:48 UTC (permalink / raw)


Per Abrahamsen <abraham@dina.kvl.dk> writes:

> Yes!  It works now.  I think you should commit it.

I just did.

> But maybe fill-flowed.el should be named rfc2646.el, to better match
> the other file names in Gnus?

I'll leave renaming for Lars to decide, I don't care either way.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch] RFC2646, MIME format=flowed support
  2000-03-26 21:48       ` Simon Josefsson
@ 2000-04-20 21:07         ` Lars Magne Ingebrigtsen
  2000-04-20 22:03           ` Simon Josefsson
  0 siblings, 1 reply; 13+ messages in thread
From: Lars Magne Ingebrigtsen @ 2000-04-20 21:07 UTC (permalink / raw)


Simon Josefsson <jas@pdc.kth.se> writes:

> > But maybe fill-flowed.el should be named rfc2646.el, to better match
> > the other file names in Gnus?
> 
> I'll leave renaming for Lars to decide, I don't care either way.

The other rfc* files are part of the Emacs MIME library, and nothing
calls those rfc* functions directly.  All calls go through the
mail-parse.el file, which calls the rfc* functions.  That way, when
new RFCs are made, one can write new rfc*.el files and choose whether
to have the mail-parse functions use the old standard or the new
standard, and so on.

I think fill-flowed.el would have been a fine name, but it's one
character too long.  What would a good, shorter name be?

-- 
(domestic pets only, the antidote for overdose, milk.)
   larsi@gnus.org * Lars Magne Ingebrigtsen



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch] RFC2646, MIME format=flowed support
  2000-04-20 21:07         ` Lars Magne Ingebrigtsen
@ 2000-04-20 22:03           ` Simon Josefsson
  2000-04-20 22:52             ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Simon Josefsson @ 2000-04-20 22:03 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> I think fill-flowed.el would have been a fine name, but it's one
> character too long.  What would a good, shorter name be?

fillflowed.el?

(13 characters the limit?  There seem to be other filenames of length
14 in the lisp/ directory too.)



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch] RFC2646, MIME format=flowed support
  2000-04-20 22:03           ` Simon Josefsson
@ 2000-04-20 22:52             ` Lars Magne Ingebrigtsen
  2000-04-20 23:17               ` Simon Josefsson
  0 siblings, 1 reply; 13+ messages in thread
From: Lars Magne Ingebrigtsen @ 2000-04-20 22:52 UTC (permalink / raw)


Simon Josefsson <jas@pdc.kth.se> writes:

> > I think fill-flowed.el would have been a fine name, but it's one
> > character too long.  What would a good, shorter name be?
> 
> fillflowed.el?

How about flow-fill.el?

> (13 characters the limit?  There seem to be other filenames of length
> 14 in the lisp/ directory too.)

14 characters (including the "c" in ".elc") is the limit, so it's 10
characters before the dot.

-- 
(domestic pets only, the antidote for overdose, milk.)
   larsi@gnus.org * Lars Magne Ingebrigtsen



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch] RFC2646, MIME format=flowed support
  2000-04-20 22:52             ` Lars Magne Ingebrigtsen
@ 2000-04-20 23:17               ` Simon Josefsson
  2000-04-20 23:36                 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Simon Josefsson @ 2000-04-20 23:17 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> > > I think fill-flowed.el would have been a fine name, but it's one
> > > character too long.  What would a good, shorter name be?
> > 
> > fillflowed.el?
> 
> How about flow-fill.el?

Sure.

Maybe rfc2646.el isn't so bad after all. :-)



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch] RFC2646, MIME format=flowed support
  2000-04-20 23:17               ` Simon Josefsson
@ 2000-04-20 23:36                 ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 13+ messages in thread
From: Lars Magne Ingebrigtsen @ 2000-04-20 23:36 UTC (permalink / raw)


Simon Josefsson <jas@pdc.kth.se> writes:

> > How about flow-fill.el?
> 
> Sure.

Ok; I'll rename it now.

-- 
(domestic pets only, the antidote for overdose, milk.)
   larsi@gnus.org * Lars Magne Ingebrigtsen



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2000-04-20 23:36 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-17 16:50 [patch] RFC2646, MIME format=flowed support Simon Josefsson
2000-02-24 16:56 ` Per Abrahamsen
2000-03-11 21:47   ` Simon Josefsson
2000-03-15  8:57     ` Per Abrahamsen
2000-03-15  9:05       ` Hrvoje Niksic
2000-03-15 12:39         ` Eric S. Johansson
2000-03-15 13:39         ` Andi Hechtbauer
2000-03-26 21:48       ` Simon Josefsson
2000-04-20 21:07         ` Lars Magne Ingebrigtsen
2000-04-20 22:03           ` Simon Josefsson
2000-04-20 22:52             ` Lars Magne Ingebrigtsen
2000-04-20 23:17               ` Simon Josefsson
2000-04-20 23:36                 ` Lars Magne Ingebrigtsen

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