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.
This commit is contained in:
Kyle Meyer 2020-09-07 23:17:30 -04:00
parent 1c5bebdad9
commit 824a4a14b0
1 changed files with 10 additions and 3 deletions

View File

@ -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