From 1be13d57dc8357576a8285c6dadc03db9e3ed7b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Delafond?= Date: Tue, 25 Aug 2015 12:27:35 +0200 Subject: Imported Upstream version 8.3.1 --- lisp/org-gnus.el | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'lisp/org-gnus.el') diff --git a/lisp/org-gnus.el b/lisp/org-gnus.el index 785b577..c0087a1 100644 --- a/lisp/org-gnus.el +++ b/lisp/org-gnus.el @@ -36,11 +36,13 @@ (eval-when-compile (require 'gnus-sum)) ;; Declare external functions and variables + (declare-function message-fetch-field "message" (header &optional not-all)) (declare-function message-narrow-to-head-1 "message" nil) (declare-function nnimap-group-overview-filename "nnimap" (group server)) -;; The following line suppresses a compiler warning stemming from gnus-sum.el (declare-function gnus-summary-last-subject "gnus-sum" nil) +(declare-function nnvirtual-map-article "nnvirtual" (article)) + ;; Customization variables (org-defvaralias 'org-usenet-links-prefer-google 'org-gnus-prefer-web-links) @@ -60,7 +62,7 @@ Normally, this translation is done by querying the IMAP server, which is usually very fast. Unfortunately, some (maybe badly configured) IMAP servers don't support this operation quickly. So if following a link to a Gnus article takes ages, try setting -this variable to `t'." +this variable to t." :group 'org-link-store :version "24.1" :type 'boolean) @@ -170,6 +172,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) @@ -249,10 +255,8 @@ 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 (org-no-properties group))) - (when article - (setq article (org-no-properties article))) + (setq group (org-no-properties group)) + (setq article (org-no-properties article)) (cond ((and group article) (gnus-activate-group group) (condition-case nil -- cgit v1.2.3