From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Alexander Gerds Subject: Re: proposed change of org-gnus-store-link for nnir groups Date: Thu, 17 Dec 2015 07:14:12 +0100 Message-ID: <86y4ctfvpn.fsf@biostat.ku.dk> References: <86bn9whtym.fsf@biostat.ku.dk> <871tamaynu.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38183) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9RpV-0007OK-82 for emacs-orgmode@gnu.org; Thu, 17 Dec 2015 01:14:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9RpR-0005OG-7X for emacs-orgmode@gnu.org; Thu, 17 Dec 2015 01:14:21 -0500 Received: from mail-lb0-x22a.google.com ([2a00:1450:4010:c04::22a]:34532) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9RpQ-0005OA-VL for emacs-orgmode@gnu.org; Thu, 17 Dec 2015 01:14:17 -0500 Received: by mail-lb0-x22a.google.com with SMTP id cs9so38932096lbb.1 for ; Wed, 16 Dec 2015 22:14:16 -0800 (PST) In-Reply-To: <871tamaynu.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Wed, 16 Dec 2015 22:09:25 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org, Nicolas Goaziou --=-=-= Content-Type: text/plain great. the updated patch is attached. for ORG-NEWS: ,---- | *** Links | **** Links stored by org-gnus-store-link in nnir groups | | Since gnus nnir groups are temporary, org-gnus-store-link | now refers to the article's original group. `---- best Nicolas Goaziou writes: > Hello, > > Thomas Alexander Gerds writes: > >> sometimes after searching for mail with notmuch, I want to save a >> link to one of the articles shown in the nnir summary. since nnir >> groups are temporary I would like org-gnus-store-link to treat nnir >> groups differently and to use the articles orginal group when >> creating the link. the following 3 lines change of >> org-gnus-store-link does this for me. if this is interesting for >> others maybe it could be integrated ... if not, I could either >> advice org-gnus-store-link or add a modified version to >> org-store-link-functions. comments? > > Sounds good. Thank you. > >> (when (eq (car (gnus-find-method-for-group >> gnus-newsgroup-name)) 'nnvirtual) (setq group (car >> (nnvirtual-map-article (gnus-summary-article-number))))) + (when (eq >> (car (gnus-find-method-for-group gnus-newsgroup-name)) + 'nnir) + >> (setq group (nnir-article-group (gnus-summary-article-number)))) > > I think the above could be wrapped within a cl-case, if only to > compute (car (gnus-find-method-for-group gnus-newsgroup-name)) only > once. Also, it may require an entry in ORG-NEWS, and a proper commit > message. > > Would you mind sending an updated patch? > > Regards, Thomas A. Gerds -- Assoc. Prof. Department of Biostatistics University of Copenhagen, Oester Farimagsgade 5, 1014 Copenhagen, Denmark Office: CSS-15.2.07 (Gamle Kommunehospital) tel: 35327914 (sec: 35327901) --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=patch-org-gnus.txt commit f56d29a57ed965029c1b5f3929f3085423e46f18 Author: Thomas Alexander Gerds Date: Thu Dec 17 06:57:11 2015 +0100 org-gnus: avoid links to nnir groups diff --git a/lisp/org-gnus.el b/lisp/org-gnus.el index c7b46af..06ba4df 100644 --- a/lisp/org-gnus.el +++ b/lisp/org-gnus.el @@ -172,10 +172,12 @@ 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))))) + (cl-case (car (gnus-find-method-for-group gnus-newsgroup-name)) + (nnvirtual + (setq group (car (nnvirtual-map-article + (gnus-summary-article-number))))) + (nnir + (setq group (nnir-article-group (gnus-summary-article-number))))) ;; Remove text properties of subject string to avoid Emacs bug ;; #3506 (set-text-properties 0 (length subject) nil subject) --=-=-=--