From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tassilo Horn Subject: Re: Problem with org-gnus-follow-link Date: Thu, 11 Dec 2008 19:17:38 +0100 Message-ID: <87y6ymvanx.fsf@thinkpad.tsdh.de> References: <8763lt8euq.fsf@thinkpad.tsdh.de> <87oczjg85v.fsf@thinkpad.tsdh.de> <87zlj39dqj.fsf@thinkpad.tsdh.de> <87ej0eajb5.fsf@thinkpad.tsdh.de> <87abb2aeoh.fsf@thinkpad.tsdh.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LAq6i-0004xQ-Rw for emacs-orgmode@gnu.org; Thu, 11 Dec 2008 13:17:52 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LAq6h-0004x8-O0 for emacs-orgmode@gnu.org; Thu, 11 Dec 2008 13:17:52 -0500 Received: from [199.232.76.173] (port=36054 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LAq6h-0004x3-Ke for emacs-orgmode@gnu.org; Thu, 11 Dec 2008 13:17:51 -0500 Received: from main.gmane.org ([80.91.229.2]:53242 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LAq6g-0003ua-Rq for emacs-orgmode@gnu.org; Thu, 11 Dec 2008 13:17:51 -0500 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LAq6c-0007pW-Gn for emacs-orgmode@gnu.org; Thu, 11 Dec 2008 18:17:46 +0000 Received: from p54af27b7.dip0.t-ipconnect.de ([84.175.39.183]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 11 Dec 2008 18:17:46 +0000 Received: from tassilo by p54af27b7.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 11 Dec 2008 18:17:46 +0000 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= Hi Ulf, please try this one. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=fix-gnus-links.patch diff --git a/lisp/org-gnus.el b/lisp/org-gnus.el index 7231538..3cf4b1e 100644 --- a/lisp/org-gnus.el +++ b/lisp/org-gnus.el @@ -74,11 +74,11 @@ If `org-store-link' was called with a prefix arg the meaning of (if (and (string-match "^nntp" group) ;; Only for nntp groups (org-xor current-prefix-arg org-gnus-prefer-web-links)) - (concat (if (string-match "gmane" unprefixed-group) - "http://news.gmane.org/" - "http://groups.google.com/group/") - unprefixed-group) - (concat "gnus:" group)))) + (org-make-link (if (string-match "gmane" unprefixed-group) + "http://news.gmane.org/" + "http://groups.google.com/group/") + unprefixed-group) + (org-make-link "gnus:" group)))) (defun org-gnus-article-link (group newsgroups message-id x-no-archive) "Create a link to a Gnus article. @@ -115,7 +115,7 @@ If `org-store-link' was called with a prefix arg the meaning of (unless group (error "Not on a group")) (org-store-link-props :type "gnus" :group group) (setq desc (org-gnus-group-link group) - link (org-make-link desc)) + link desc) (org-add-link-props :link link :description desc) link)) @@ -149,6 +149,10 @@ If `org-store-link' was called with a prefix arg the meaning of (error "Error in Gnus link")) (setq group (match-string 1 path) article (match-string 3 path)) + (when group + (setq group (substring-no-properties group))) + (when article + (setq article (substring-no-properties article))) (org-gnus-follow-link group article))) (defun org-gnus-follow-link (&optional group article) @@ -156,13 +160,16 @@ If `org-store-link' was called with a prefix arg the meaning of (require 'gnus) (funcall (cdr (assq 'gnus org-link-frame-setup))) (if gnus-other-frame-object (select-frame gnus-other-frame-object)) + (when group + (setq group (substring-no-properties group))) + (when article + (setq article (substring-no-properties article))) (cond ((and group article) - (gnus-group-read-group 1 nil group) - (gnus-summary-goto-article - (if (string-match "[^0-9]" article) - article - (string-to-number article)) - nil t)) + (gnus-activate-group group t) + (unless (gnus-group-read-group 1 nil group) + ;; Try again with a bigger number of messages. + (gnus-group-read-group (1- gnus-large-newsgroup) nil group)) + (gnus-summary-goto-article article nil t)) (group (gnus-group-jump-to-group group)))) (defun org-gnus-no-new-news () --=-=-= Bye, Tassilo -- "OS's and GUI's come and go, only Emacs has lasting power." Per Abrahamsen in --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-=-=--