diff options
author | Kyle Meyer <kyle@kyleam.com> | 2020-09-07 23:17:30 -0400 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2020-09-07 23:19:15 -0400 |
commit | 824a4a14b0f91621294e1a6563ce85eeaea0549a (patch) | |
tree | ccfb02fe67465b9a308226ecdfbdf5aebde890c6 | |
parent | 1c5bebdad9f73a288e46e4991204969d8b3edf64 (diff) | |
download | org-mode-824a4a14b0f91621294e1a6563ce85eeaea0549a.tar.gz |
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.
-rw-r--r-- | lisp/ol-gnus.el | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lisp/ol-gnus.el b/lisp/ol-gnus.el index c3c53ed..af88c1a 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 |