emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: emacs-orgmode@gnu.org
Subject: [Patch] Create org-gnus links to real groups, not virtual groups
Date: Thu, 12 Jun 2014 12:57:40 +0800	[thread overview]
Message-ID: <8761k6912z.fsf@ericabrahamsen.net> (raw)

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

If you create a link to a gnus message while in a nnvirtual group, the
link will become un-followable as soon as you exit the virtual group.
This patch checks to see if we're in a virtual group, and if so it
creates the link to the original group instead.

E


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Create-org-gnus-links-from-original-group-not-virtua.patch --]
[-- Type: text/x-diff, Size: 1219 bytes --]

From 2d1dbbeb071e256ff37be798e8e04689a40665c8 Mon Sep 17 00:00:00 2001
From: Eric Abrahamsen <eric@ericabrahamsen.net>
Date: Thu, 12 Jun 2014 12:53:15 +0800
Subject: [PATCH] Create org-gnus links from original group, not virtual

lisp/org-gnus.el (org-gnus-store-link): If we happen to be in a
		 virtual group when storing a link to a message, we
		 want the link to point to the message's "real" group,
		 as a link to a virtual group can't be followed later.
---
 lisp/org-gnus.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lisp/org-gnus.el b/lisp/org-gnus.el
index 2c79347..48afb3c 100644
--- a/lisp/org-gnus.el
+++ b/lisp/org-gnus.el
@@ -170,6 +170,10 @@ If `org-store-link' was called with a prefix arg the meaning of
 	   (subject (copy-sequence (mail-header-subject header)))
 	   (to (cdr (assq 'To (mail-header-extra header))))
 	   newsgroups x-no-archive desc link)
+      (when (eq (car (gnus-find-method-for-group gnus-newsgroup-name))
+		  'nnvirtual)
+	(setq group (car (nnvirtual-map-article
+			  (gnus-summary-article-number)))))
       ;; Remove text properties of subject string to avoid Emacs bug
       ;; #3506
       (set-text-properties 0 (length subject) nil subject)
-- 
2.0.0


             reply	other threads:[~2014-06-12  4:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-12  4:57 Eric Abrahamsen [this message]
2014-06-13  9:54 ` [Patch] Create org-gnus links to real groups, not virtual groups Bastien

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=8761k6912z.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --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).