emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tassilo@member.fsf.org>
To: emacs-orgmode@gnu.org
Subject: Re: Problem with org-gnus-follow-link
Date: Thu, 11 Dec 2008 19:17:38 +0100	[thread overview]
Message-ID: <87y6ymvanx.fsf@thinkpad.tsdh.de> (raw)
In-Reply-To: zf.upnk5a63cu9.fsf@zeitform.de

[-- Attachment #1: Type: text/plain, Size: 31 bytes --]

Hi Ulf,

please try this one.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: fix-gnus-links.patch --]
[-- Type: text/x-patch, Size: 2526 bytes --]

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 ()

[-- Attachment #3: Type: text/plain, Size: 146 bytes --]


Bye,
Tassilo
-- 
      "OS's and GUI's come and go, only Emacs has lasting power."
          Per Abrahamsen in <rjbsysc7n1.fsf@zuse.dina.kvl.dk>

[-- Attachment #4: Type: text/plain, Size: 204 bytes --]

_______________________________________________
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

  parent reply	other threads:[~2008-12-11 18:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-09 12:24 Problem with org-gnus-follow-link Ulf Stegemann
2008-12-09 16:58 ` Tassilo Horn
2008-12-10 10:08   ` Ulf Stegemann
2008-12-10 19:08     ` Tassilo Horn
2008-12-11 10:09       ` Ulf Stegemann
2008-12-11 11:02         ` Tassilo Horn
2008-12-11 13:52           ` Ulf Stegemann
2008-12-11 14:16             ` Tassilo Horn
2008-12-11 15:37               ` Ulf Stegemann
2008-12-11 15:56                 ` Tassilo Horn
2008-12-11 16:18                   ` Ulf Stegemann
2008-12-11 16:41                     ` Tassilo Horn
2008-12-11 18:17                     ` Tassilo Horn [this message]
2008-12-11 21:51                       ` Ulf Stegemann
2008-12-12  7:04                         ` Tassilo Horn
2008-12-12  8:17                           ` Ulf Stegemann
2008-12-12 10:31                             ` Tassilo Horn
2008-12-12 14:21                               ` Ulf Stegemann
2008-12-11  8:15     ` Tassilo Horn

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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y6ymvanx.fsf@thinkpad.tsdh.de \
    --to=tassilo@member.fsf.org \
    --cc=emacs-orgmode@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).