emacs-orgmode
[Top][All Lists]
Advanced

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

[Orgmode] Re: Problem with org-gnus-follow-link


From: Tassilo Horn
Subject: [Orgmode] Re: Problem with org-gnus-follow-link
Date: Thu, 11 Dec 2008 19:17:38 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Hi Ulf,

please try this one.

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 <address@hidden>

reply via email to

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