Gnus development mailing list
 help / color / mirror / Atom feed
* [PATCH] Make message-insert-citation-line works with nnrss groups
@ 2006-09-14 19:41 Andrea Russo
  2006-09-14 23:57 ` Katsumi Yamaoka
  0 siblings, 1 reply; 4+ messages in thread
From: Andrea Russo @ 2006-09-14 19:41 UTC (permalink / raw)


Hi,

There is a bug in `message-insert-citation-line' that happens when
trying to reply to an article in a nnrss group.

Various blogging software doesn't set a `From' header in blog posts,
so when gnus tries to cite the author of the post, it hits a `Wrong
type argument' error.

This patch tries to fix this.

Best Regards,
Andrea Russo.

--- orig/lisp/gnus/ChangeLog
+++ mod/lisp/gnus/ChangeLog
@@ -1,3 +1,8 @@
+2006-09-14  Andrea Russo  <rast4ndy@gmail.com>
+
+	* message.el (message-insert-citation-line): Check if the from header
+	is nil.  This may happens in articles from nnrss groups.
+


--- orig/lisp/gnus/message.el
+++ mod/lisp/gnus/message.el
@@ -3346,9 +3346,11 @@
 (defun message-insert-citation-line ()
   "Insert a simple citation line."
   (when message-reply-headers
-    (insert (mail-header-from message-reply-headers) " writes:")
-    (newline)
-    (newline)))
+    (let ((from (mail-header-from message-reply-headers)))
+      (when from
+	(insert from " writes:"))
+      (newline)
+      (newline))))
 
 (defun message-position-on-field (header &rest afters)
   (let ((case-fold-search t))




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

* Re: [PATCH] Make message-insert-citation-line works with nnrss groups
  2006-09-14 19:41 [PATCH] Make message-insert-citation-line works with nnrss groups Andrea Russo
@ 2006-09-14 23:57 ` Katsumi Yamaoka
  2006-09-16  6:52   ` Katsumi Yamaoka
  2006-09-16 10:50   ` Andrea Russo
  0 siblings, 2 replies; 4+ messages in thread
From: Katsumi Yamaoka @ 2006-09-14 23:57 UTC (permalink / raw)
  Cc: ding

>>>>> In <87ejuekzhm.fsf@onosendai.org> Andrea Russo wrote:

> There is a bug in `message-insert-citation-line' that happens when
> trying to reply to an article in a nnrss group.

> Various blogging software doesn't set a `From' header in blog posts,
> so when gnus tries to cite the author of the post, it hits a `Wrong
> type argument' error.

I agree that's really a bug.

> This patch tries to fix this.

[...]

> +2006-09-14  Andrea Russo  <rast4ndy@gmail.com>
> +
> +	* message.el (message-insert-citation-line): Check if the from header
> +	is nil.  This may happens in articles from nnrss groups.

In No Gnus, `message-insert-formated-citation-line' which is
another candidate to `message-citation-line-function' should be
fixed as well.  Furthermore, any function that a user specified
to that variable should suppose `From' might not be present in
the `message-reply-headers' variable.  Instead, how about making
`From' default to `nobody'?  Here's another patch to Gnus v5.11:

--- message.el~	2006-09-05 21:59:23 +0000
+++ message.el	2006-09-14 23:55:26 +0000
@@ -3280,7 +3280,7 @@
 	    (message-narrow-to-head-1)
 	    (vector 0
 		    (or (message-fetch-field "subject") "none")
-		    (message-fetch-field "from")
+		    (or (message-fetch-field "from") "nobody")
 		    (message-fetch-field "date")
 		    (message-fetch-field "message-id" t)
 		    (message-fetch-field "references")
@@ -3329,7 +3329,7 @@
 	      (message-narrow-to-head-1)
 	      (vector 0
 		      (or (message-fetch-field "subject") "none")
-		      (message-fetch-field "from")
+		      (or (message-fetch-field "from") "nobody")
 		      (message-fetch-field "date")
 		      (message-fetch-field "message-id" t)
 		      (message-fetch-field "references")



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

* Re: [PATCH] Make message-insert-citation-line works with nnrss groups
  2006-09-14 23:57 ` Katsumi Yamaoka
@ 2006-09-16  6:52   ` Katsumi Yamaoka
  2006-09-16 10:50   ` Andrea Russo
  1 sibling, 0 replies; 4+ messages in thread
From: Katsumi Yamaoka @ 2006-09-16  6:52 UTC (permalink / raw)


>>>>> In <b4m7j06c87n.fsf@jpl.org> Katsumi Yamaoka wrote:

>>>>>> In <87ejuekzhm.fsf@onosendai.org> Andrea Russo wrote:

>> There is a bug in `message-insert-citation-line' that happens when
>> trying to reply to an article in a nnrss group.

>> Various blogging software doesn't set a `From' header in blog posts,
>> so when gnus tries to cite the author of the post, it hits a `Wrong
>> type argument' error.

> I agree that's really a bug.

>> This patch tries to fix this.

> [...]

>> +2006-09-14  Andrea Russo  <rast4ndy@gmail.com>
>> +
>> +	* message.el (message-insert-citation-line): Check if the from header
>> +	is nil.  This may happens in articles from nnrss groups.

> In No Gnus, `message-insert-formated-citation-line' which is
> another candidate to `message-citation-line-function' should be
> fixed as well.  Furthermore, any function that a user specified
> to that variable should suppose `From' might not be present in
> the `message-reply-headers' variable.  Instead, how about making
> `From' default to `nobody'?  Here's another patch to Gnus v5.11:

There's neither a followup nor a comment, but I've installed the
changes in both the trunk and the v5-10 branch.



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

* Re: [PATCH] Make message-insert-citation-line works with nnrss groups
  2006-09-14 23:57 ` Katsumi Yamaoka
  2006-09-16  6:52   ` Katsumi Yamaoka
@ 2006-09-16 10:50   ` Andrea Russo
  1 sibling, 0 replies; 4+ messages in thread
From: Andrea Russo @ 2006-09-16 10:50 UTC (permalink / raw)


Katsumi Yamaoka <yamaoka@jpl.org> writes:

> In No Gnus, `message-insert-formated-citation-line' which is
> another candidate to `message-citation-line-function' should be
> fixed as well.  Furthermore, any function that a user specified
> to that variable should suppose `From' might not be present in
> the `message-reply-headers' variable.  Instead, how about making
> `From' default to `nobody'?  Here's another patch to Gnus v5.11:

That's good for me.  I don't like much having `nobody' in the citation
line, but that can be easily customized so I think it's ok as a
default.

Thank you very much,
Andrea.




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

end of thread, other threads:[~2006-09-16 10:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-14 19:41 [PATCH] Make message-insert-citation-line works with nnrss groups Andrea Russo
2006-09-14 23:57 ` Katsumi Yamaoka
2006-09-16  6:52   ` Katsumi Yamaoka
2006-09-16 10:50   ` Andrea Russo

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