* proposed change of org-gnus-store-link for nnir groups
@ 2015-12-12 9:55 Thomas Alexander Gerds
2015-12-16 21:09 ` Nicolas Goaziou
0 siblings, 1 reply; 6+ messages in thread
From: Thomas Alexander Gerds @ 2015-12-12 9:55 UTC (permalink / raw)
To: emacs-orgmode
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?
Thomas
lisp/org-gnus.el
diff --git a/lisp/org-gnus.el b/lisp/org-gnus.el
index c7b46af..b5cf9c9 100644
*** a/lisp/org-gnus.el
Highlight differences
--- a/lisp/org-gnus.el
+++ b/lisp/org-gnus.el
@@ -173,9 +173,12 @@ If `org-store-link' was called with a prefix arg the meaning of
(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)))))
+ (when (eq (car (gnus-find-method-for-group gnus-newsgroup-name))
+ '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)
--
sent from nil
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: proposed change of org-gnus-store-link for nnir groups
2015-12-12 9:55 proposed change of org-gnus-store-link for nnir groups Thomas Alexander Gerds
@ 2015-12-16 21:09 ` Nicolas Goaziou
2015-12-17 6:14 ` Thomas Alexander Gerds
0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2015-12-16 21:09 UTC (permalink / raw)
To: Thomas Alexander Gerds; +Cc: emacs-orgmode
Hello,
Thomas Alexander Gerds <tag@biostat.ku.dk> 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,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: proposed change of org-gnus-store-link for nnir groups
2015-12-16 21:09 ` Nicolas Goaziou
@ 2015-12-17 6:14 ` Thomas Alexander Gerds
2015-12-17 8:57 ` Nicolas Goaziou
0 siblings, 1 reply; 6+ messages in thread
From: Thomas Alexander Gerds @ 2015-12-17 6:14 UTC (permalink / raw)
To: emacs-orgmode, Nicolas Goaziou
[-- Attachment #1: Type: text/plain, Size: 1764 bytes --]
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 <mail@nicolasgoaziou.fr> writes:
> Hello,
>
> Thomas Alexander Gerds <tag@biostat.ku.dk> 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)
[-- Attachment #2: patch-org-gnus.txt --]
[-- Type: text/plain, Size: 1110 bytes --]
commit f56d29a57ed965029c1b5f3929f3085423e46f18
Author: Thomas Alexander Gerds <tag@biostat.ku.dk>
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)
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: proposed change of org-gnus-store-link for nnir groups
2015-12-17 6:14 ` Thomas Alexander Gerds
@ 2015-12-17 8:57 ` Nicolas Goaziou
2015-12-18 6:49 ` Thomas Alexander Gerds
0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2015-12-17 8:57 UTC (permalink / raw)
To: Thomas Alexander Gerds; +Cc: emacs-orgmode
Hello,
Thomas Alexander Gerds <tag@biostat.ku.dk> writes:
> great. the updated patch is attached.
It looks good. Thank you. One minor comment below.
> 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.
> `----
OK.
> commit f56d29a57ed965029c1b5f3929f3085423e46f18
> Author: Thomas Alexander Gerds <tag@biostat.ku.dk>
> Date: Thu Dec 17 06:57:11 2015 +0100
>
> org-gnus: avoid links to nnir groups
"Avoid"
You also need to refer to the function modified, e.g.,
* lisp/org-gnus.el (org-gnus-store-link): Articles in an nnir group
refer to the original group.
Eventually, if you haven't signed FSF papers, you also need to add
"TINYCHANGE" at the end of the message.
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: proposed change of org-gnus-store-link for nnir groups
2015-12-17 8:57 ` Nicolas Goaziou
@ 2015-12-18 6:49 ` Thomas Alexander Gerds
2015-12-18 21:45 ` Nicolas Goaziou
0 siblings, 1 reply; 6+ messages in thread
From: Thomas Alexander Gerds @ 2015-12-18 6:49 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1238 bytes --]
yes, I now found the "how to contribute" page :) the updated patch is
attached. thanks!
Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
> Hello,
>
> Thomas Alexander Gerds <tag@biostat.ku.dk> writes:
>
>> great. the updated patch is attached.
>
> It looks good. Thank you. One minor comment below.
>
>> 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.
>> `----
>
> OK.
>
>> commit f56d29a57ed965029c1b5f3929f3085423e46f18 Author: Thomas
>> Alexander Gerds <tag@biostat.ku.dk> Date: Thu Dec 17 06:57:11 2015
>> +0100
>> org-gnus: avoid links to nnir groups
>
> "Avoid"
>
> You also need to refer to the function modified, e.g.,
>
> * lisp/org-gnus.el (org-gnus-store-link): Articles in an nnir group
> refer to the original group.
>
> Eventually, if you haven't signed FSF papers, you also need to add
> "TINYCHANGE" at the end of the message.
>
> 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)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-gnus.el-change-nnir-group-reference.patch --]
[-- Type: text/x-diff, Size: 1359 bytes --]
From 907bf2c9b474a740f6ec4cbe8a79db1b7d995276 Mon Sep 17 00:00:00 2001
From: Thomas Alexander Gerds <tag@biostat.ku.dk>
Date: Fri, 18 Dec 2015 07:43:38 +0100
Subject: [PATCH] org-gnus.el: change nnir group reference
* lisp/org-gnus.el (org-gnus-store-link): Articles in an nnir group refer to the original group
TINYCHANGE
---
lisp/org-gnus.el | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/lisp/org-gnus.el b/lisp/org-gnus.el
index c7b46af..11345a0 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)
--
2.1.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-12-18 21:43 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-12 9:55 proposed change of org-gnus-store-link for nnir groups Thomas Alexander Gerds
2015-12-16 21:09 ` Nicolas Goaziou
2015-12-17 6:14 ` Thomas Alexander Gerds
2015-12-17 8:57 ` Nicolas Goaziou
2015-12-18 6:49 ` Thomas Alexander Gerds
2015-12-18 21:45 ` Nicolas Goaziou
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.