[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: org-gnus.el returns incorrect message subject in article mode

From: Katsumi Yamaoka
Subject: Re: org-gnus.el returns incorrect message subject in article mode
Date: Fri, 05 Jun 2009 19:08:17 +0900
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.94 (gnu/linux)

>>>>> Tassilo Horn wrote:
> finalpatch <address@hidden> writes:

>> I found that running org-store-link inside a gnus article buffer gives
>> out incorrect message subject.

> Indeed, that's wrong.

>> This is because in gnus-article-mode the gnus-summary-subject-string
>> function returns the subject of the next message instead of the
>> current one.

> Hm, maybe that is a gnus bug?  Katsumi or Reiner?

No, it isn't a Gnus bug, I believe.  The `gnus-summary-subject-string'
macro was designed to be used in the summary buffer.  So finalpatch's
solution looks correct.

>> The following patch fixes this problem for me.

> Thanks, I've applied the patch to the git version of org as well as the
> version included in emacs.

Since the patch makes it search for the subject in the whole
article body, it might misfetch it if the header doesn't have
the subject but there is the one that looks like the subject in
the body.  A better way will be:

--- org-gnus.el~        2009-06-05 10:01:51 +0000
+++ org-gnus.el 2009-06-05 10:01:26 +0000
@@ -134,7 +134,9 @@
           (newsgroups (mail-header 'newsgroups header))
           (x-no-archive (mail-header 'x-no-archive header))
           (subject (if (eq major-mode 'gnus-article-mode)
-                       (message-fetch-field "subject")
+                       (save-restriction
+                         (message-narrow-to-head-1)
+                         (message-fetch-field "subject"))
           desc link)
       (org-store-link-props :type "gnus" :from from :subject subject

Not tested, because I've never used the org-mode.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]