all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: finalpatch <fengli@gmail.com>
Cc: reiner.steib@gmx.de, emacs-devel@gnu.org
Subject: Re: org-gnus.el returns incorrect message subject in article mode
Date: Fri, 05 Jun 2009 19:08:17 +0900	[thread overview]
Message-ID: <b4mtz2vdmcu.fsf@jpl.org> (raw)
In-Reply-To: 87fxefjg1m.fsf@thinkpad.tsdh.de

>>>>> Tassilo Horn wrote:
> finalpatch <fengli@gmail.com> 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"))
 		      (gnus-summary-subject-string)))
 	   desc link)
       (org-store-link-props :type "gnus" :from from :subject subject

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

Regards,




      reply	other threads:[~2009-06-05 10:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-05  1:19 org-gnus.el returns incorrect message subject in article mode finalpatch
2009-06-05  7:28 ` Tassilo Horn
2009-06-05 10:08   ` Katsumi Yamaoka [this message]

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=b4mtz2vdmcu.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=emacs-devel@gnu.org \
    --cc=fengli@gmail.com \
    --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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.