From: Andrew Cohen Date: Thu, 4 Apr 2013 22:15:25 +0000 (+0000) Subject: gnus-msg.el: Fix detection of nnir group X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~2026^2~526^2~5 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=567d89caf1304c780e3cedc9db4c31a2ce57d588;p=emacs.git gnus-msg.el: Fix detection of nnir group --- diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 59be8293bb3..ca78e7c99b4 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,10 @@ +2013-04-04 Andrew Cohen + + * 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 * mml.el (mml-minibuffer-read-description): Use `default' insted of diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index 7503afdab36..36135556c73 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el @@ -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) diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el index e7d004a8b2c..b96f0c1cb78 100644 --- a/lisp/gnus/nnir.el +++ b/lisp/gnus/nnir.el @@ -1707,6 +1707,12 @@ actually)." ;;; Util Code: +(defun gnus-nnir-group-p (group) + "Say whether GROUP is nnir or not." + (if (gnus-group-prefixed-p group) + (eq 'nnir (car (gnus-find-method-for-group group))) + (and group (string-match "^nnir" 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 +1760,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"))