From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.devel Subject: Re: org-gnus.el returns incorrect message subject in article mode Date: Fri, 05 Jun 2009 19:08:17 +0900 Organization: Emacsen advocacy group Message-ID: References: <873aafiijm.fsf@gmail.com> <87fxefjg1m.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1244196546 17428 80.91.229.12 (5 Jun 2009 10:09:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Jun 2009 10:09:06 +0000 (UTC) Cc: reiner.steib@gmx.de, emacs-devel@gnu.org To: finalpatch Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 05 12:09:04 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MCWM5-0000DT-DI for ged-emacs-devel@m.gmane.org; Fri, 05 Jun 2009 12:08:58 +0200 Original-Received: from localhost ([127.0.0.1]:32888 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MCWM4-0007AV-TK for ged-emacs-devel@m.gmane.org; Fri, 05 Jun 2009 06:08:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MCWLl-00075C-2t for emacs-devel@gnu.org; Fri, 05 Jun 2009 06:08:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MCWLf-00073e-58 for emacs-devel@gnu.org; Fri, 05 Jun 2009 06:08:35 -0400 Original-Received: from [199.232.76.173] (port=50393 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MCWLe-00073X-Qx for emacs-devel@gnu.org; Fri, 05 Jun 2009 06:08:31 -0400 Original-Received: from orlando.hostforweb.net ([216.246.45.90]:33633) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MCWLe-0007nC-7U for emacs-devel@gnu.org; Fri, 05 Jun 2009 06:08:30 -0400 Original-Received: from localhost ([127.0.0.1]:55040) by orlando.hostforweb.net with esmtpa (Exim 4.69) (envelope-from ) id 1MCWLZ-0003Zv-1B; Fri, 05 Jun 2009 05:08:25 -0500 X-Hashcash: 1:20:090605:fengli@gmail.com::gW+tC3/3BKqegs92:02KwQ X-Hashcash: 1:20:090605:reiner.steib@gmx.de::BQmtfp9I8XIl0cl0:0000000000000000000000000000000000000000001Zvg X-Hashcash: 1:20:090605:emacs-devel@gnu.org::usFCBCcP8U6V8GGy:000000000000000000000000000000000000000000AF/C X-Face: #kKnN,xUnmKia.'[pp`; Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu; B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.94 (gnu/linux) Cancel-Lock: sha1:paTJYzaYzKNEAZJ6DMLOPifZZm0= X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - orlando.hostforweb.net X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:111343 Archived-At: >>>>> Tassilo Horn wrote: > finalpatch 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,