From: Eric Abrahamsen Date: Sun, 8 Nov 2020 16:37:03 +0000 (-0800) Subject: Another backwards-compatibility fix for gnus-search X-Git-Tag: emacs-28.0.90~5212^2~8 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=33c7ddd47da7645a5002185414868ff654452752;p=emacs.git Another backwards-compatibility fix for gnus-search * lisp/gnus/gnus-search.el (gnus-search-server-to-engine): Because of the way we've set up the obsolete variable alias for `nnir-method-default-engines', we may end up with its value in `gnus-search-default-engines'. Make the check for "old style" values general, so we catch them no matter where they came from. --- diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index abee7c47116..fbed9029fbd 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -1963,25 +1963,29 @@ remaining string, then adds all that to the top-level spec." (defun gnus-search-server-to-engine (srv) (let* ((method (gnus-server-to-method srv)) (engine-config (assoc 'gnus-search-engine (cddr method))) - (server - (or (nth 1 engine-config) - (cdr-safe (assoc (car method) gnus-search-default-engines)) - (when-let ((old (assoc 'nnir-search-engine - (cddr method)))) - (nnheader-message - 8 "\"nnir-search-engine\" is no longer a valid parameter") - (pcase (nth 1 old) - ('notmuch 'gnus-search-notmuch) - ('namazu 'gnus-search-namazu) - ('find-grep 'gnus-search-find-grep))))) - (inst + (server (or (nth 1 engine-config) + (cdr-safe (assoc (car method) gnus-search-default-engines)) + (when-let ((old (assoc 'nnir-search-engine + (cddr method)))) + (nnheader-message + 8 "\"nnir-search-engine\" is no longer a valid parameter") + (nth 1 old)))) + inst) + (setq server + (pcase server + ('notmuch 'gnus-search-notmuch) + ('namazu 'gnus-search-namazu) + ('find-grep 'gnus-search-find-grep) + ('imap 'gnus-search-imap) + (_ server)) + inst (cond ((null server) nil) ((eieio-object-p server) server) ((class-p server) (make-instance server)) - (t nil)))) + (t nil))) (if inst (when (cddr engine-config) ;; We're not being completely backward-compatible here, @@ -1994,7 +1998,7 @@ remaining string, then adds all that to the top-level spec." (nnheader-message 5 "Invalid search engine parameter: (%s %s)" key value))))) - (error "No search engine defined for %S" method)) + (error "No search engine defined for %s" srv)) inst)) (declare-function gnus-registry-get-id-key "gnus-registry" (id key))