From 824a4a14b0f91621294e1a6563ce85eeaea0549a Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Mon, 7 Sep 2020 23:17:30 -0400 Subject: [PATCH] ol-gnus: Prefer nnselect to nnir if available * lisp/ol-gnus.el (org-gnus-store-link): Use nnselect when available. In the master branch of the Emacs repository, f103e89c1d (Add aliases for recent Gnus nnselect changes, 2020-09-07) switched org-gnus-store-link over to using nnselect, but that can't be ported as is because it isn't backward compatible. Make a similar change that includes compatibility kludges. --- lisp/ol-gnus.el | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lisp/ol-gnus.el b/lisp/ol-gnus.el index c3c53ed3c..af88c1a15 100644 --- a/lisp/ol-gnus.el +++ b/lisp/ol-gnus.el @@ -34,7 +34,8 @@ (require 'gnus-sum) (require 'gnus-util) (require 'nnheader) -(require 'nnir) +(or (require 'nnselect nil t) ; Emacs >= 28 + (require 'nnir nil t)) ; Emacs < 28 (require 'ol) @@ -135,9 +136,15 @@ If `org-store-link' was called with a prefix arg the meaning of (`(nnvirtual . ,_) (save-excursion (car (nnvirtual-map-article (gnus-summary-article-number))))) - (`(nnir . ,_) + (`(,(or `nnselect `nnir) . ,_) ; nnir is for Emacs < 28. (save-excursion - (nnir-article-group (gnus-summary-article-number)))) + (cond + ((fboundp 'nnselect-article-group) + (nnselect-article-group (gnus-summary-article-number))) + ((fboundp 'nnir-article-group) + (nnir-article-group (gnus-summary-article-number))) + (t + (error "No article-group variant bound"))))) (_ gnus-newsgroup-name))) (header (if (eq major-mode 'gnus-article-mode) ;; When in an article, first move to summary