浏览代码

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.
Kyle Meyer 4 年之前
父节点
当前提交
824a4a14b0
共有 1 个文件被更改,包括 10 次插入3 次删除
  1. 10 3
      lisp/ol-gnus.el

+ 10 - 3
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