gnus-msg.el: Fix detection of nnir group.
authorAndrew Cohen <cohen@andy.bu.edu>
Thu, 4 Apr 2013 14:14:21 +0000 (10:14 -0400)
committerAndrew Cohen <cohen@andy.bu.edu>
Thu, 4 Apr 2013 14:14:21 +0000 (10:14 -0400)
lisp/ChangeLog
lisp/gnus-msg.el
lisp/nnir.el

index 3cac579..18970c4 100644 (file)
@@ -1,3 +1,10 @@
+2013-04-04  Andrew Cohen  <cohen@bu.edu>
+
+       * nnir.el (gnus-nnir-group-p): New function.
+       (nnir-possibly-change-group): Use it.
+
+       * gnus-msg.el (gnus-setup-message): Use it.
+
 2013-04-04  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * mml.el (mml-minibuffer-read-description): Use `default' insted of
index 7503afd..3613555 100644 (file)
@@ -417,6 +417,7 @@ Thank you for your help in stamping out bugs.
 
 (autoload 'nnir-article-number "nnir" nil nil 'macro)
 (autoload 'nnir-article-group "nnir" nil nil 'macro)
+(autoload 'gnus-nnir-group-p "nnir")
 
 
 (defvar gnus-article-reply nil)
@@ -430,17 +431,15 @@ Thank you for your help in stamping out bugs.
     `(let ((,winconf (current-window-configuration))
           (,winconf-name gnus-current-window-configuration)
           (,buffer (buffer-name (current-buffer)))
-          (,article (or  (when (and
-                                (string-match "^nnir:" gnus-newsgroup-name)
-                                gnus-article-reply)
-                           (nnir-article-number gnus-article-reply))
-                          gnus-article-reply))
-          (,yanked gnus-article-yanked-articles)
-          (,group (or (when (and
-                             (string-match "^nnir:" gnus-newsgroup-name)
+          (,article (if (and (gnus-nnir-group-p gnus-newsgroup-name)
                              gnus-article-reply)
-                        (nnir-article-group gnus-article-reply))
-                      gnus-newsgroup-name))
+                        (nnir-article-number gnus-article-reply)
+                      gnus-article-reply))
+          (,yanked gnus-article-yanked-articles)
+          (,group (if (and (gnus-nnir-group-p gnus-newsgroup-name)
+                           gnus-article-reply)
+                      (nnir-article-group gnus-article-reply)
+                    gnus-newsgroup-name))
           (message-header-setup-hook
            (copy-sequence message-header-setup-hook))
           (mbl mml-buffer-list)
index cbe64ba..871ac96 100644 (file)
@@ -1707,6 +1707,11 @@ actually)."
 
 ;;; Util Code:
 
+(defun gnus-nnir-group-p (group)
+  "Say whether GROUP is nnir or not."
+  (eq 'nnir (car (gnus-find-method-for-group group))))
+
+
 (defun nnir-read-parms (nnir-search-engine)
   "Reads additional search parameters according to `nnir-engines'."
   (let ((parmspec (caddr (assoc nnir-search-engine nnir-engines))))
@@ -1754,7 +1759,7 @@ environment unless `not-global' is non-nil."
 
 (defun nnir-possibly-change-group (group &optional server)
   (or (not server) (nnir-server-opened server) (nnir-open-server server))
-  (when (and group (string-match "\\`nnir" group))
+  (when (gnus-nnir-group-p group)
     (setq nnir-artlist (gnus-group-get-parameter
                        (gnus-group-prefixed-name
                         (gnus-group-short-name group) '(nnir "nnir"))