From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 2791 invoked from network); 5 Nov 2020 16:07:02 -0000 Received: from mx1.math.uh.edu (129.7.128.32) by inbox.vuxu.org with ESMTPUTF8; 5 Nov 2020 16:07:02 -0000 Received: from lists1.math.uh.edu ([129.7.128.208]) by mx1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1kahkl-00EjYz-E8; Thu, 05 Nov 2020 10:04:47 -0600 Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.94) (envelope-from ) id 1kahkk-0093nE-Di; Thu, 05 Nov 2020 10:04:46 -0600 Received: from mx2.math.uh.edu ([129.7.128.33]) by lists1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1kahkg-0093lX-0R for ding@lists.math.uh.edu; Thu, 05 Nov 2020 10:04:42 -0600 Received: from quimby.gnus.org ([95.216.78.240]) by mx2.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1kahke-003iV0-37 for ding@lists.math.uh.edu; Thu, 05 Nov 2020 10:04:41 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=A1uvE14GGMjC+YiBx6Ugm+cy9009t4N8Y20W9Bzh6mc=; b=XHAeaY/owcGBDbg/M4WUAO+WEF V5UssSXW+MKmAj5/l21X95pSYBsV77OfkvQcWx78vZrgXbf+q+KBmF/G5GD4GrVcQylNONTktxSXd H4Rp9/1dAdPR0s3N/EEDhdGaAa9ex9M+yG12d+XoDKuj0cLz91rAFDMSIt0XKukQ5o7g=; Received: from ericabrahamsen.net ([52.70.2.18] helo=mail.ericabrahamsen.net) by quimby.gnus.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kahkW-0004IF-Au for ding@gnus.org; Thu, 05 Nov 2020 17:04:35 +0100 Received: from localhost (c-73-254-86-141.hsd1.wa.comcast.net [73.254.86.141]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id AB7F2FA16E; Thu, 5 Nov 2020 16:04:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1604592269; bh=A1uvE14GGMjC+YiBx6Ugm+cy9009t4N8Y20W9Bzh6mc=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=kqF3lpJO3lSd+FZdIC99gB/NrzX09Q1zakFpSPPrecktDYxIDvk5eBl6psOvTJhZn +FwpNKWiFW7jOjnO6G/ksmhci7O+ZLlQia7ILKQZBU+H0gECyLyLkMAzFSAFO2SNCh 7goC6N3stheeZx3O9eppNBN6M5WCCgxKScqyYVHE= From: Eric Abrahamsen To: Adam =?utf-8?Q?Sj=C3=B8gren?= Cc: ding@gnus.org Subject: Re: New "gnus-search" syntax and interface References: <87blgdavsb.fsf@ericabrahamsen.net> <87k0v0rp64.fsf@tullinup.koldfront.dk> Date: Thu, 05 Nov 2020 08:04:22 -0800 In-Reply-To: <87k0v0rp64.fsf@tullinup.koldfront.dk> ("Adam =?utf-8?Q?Sj?= =?utf-8?Q?=C3=B8gren=22's?= message of "Thu, 05 Nov 2020 12:58:11 +0100") Message-ID: <87o8kb94e1.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-ID: Precedence: bulk Adam Sj=C3=B8gren writes: > Eric writes: > >> Past that, the fun stuff comes if you set >> `gnus-search-use-parsed-queries' to t. That will enable the "generalized >> query syntax", a single search syntax that can be used across any >> supported search engine. > > I did that, placed point on nnml:normal and pressed G G as I usually do. > Entered at string to search for at the Query: prompt, and instead of the > expected results returned from notmuch, I got: > > No search engine defined for nnml: > cl-no-applicable-method: No applicable method: gnus-search-run-search, > nil, "nnml:", ((parsed-query "Leaf") (query . "Leaf") (raw)), > ("nnml:normal") > > My mail method is defined like this: > > (setq asjo-local-mail-method '(nnml "" > (nnir-search-engine notmuch))) > > [...] > > (setq gnus-secondary-select-methods > `( > ,asjo-local-mail-method > [...] > > (My archive method is also nnml - nnml:archive, and also has > (nnir-search-engine notmuch).) > > I get the same error if I switch gnus-search-use-parsed-queries to nil. > > Do I need to tell Gnus that I want to use notmuch in a new way? Apparently I borked the backward compatibility. The new way to define the search engine (in your case) would be (gnus-search-engine gnus-search-notmuch) but old `nnir-search-engine' way should definitely be supported. Would you please eval the below and confirm that it works correctly? Thanks! (defun gnus-search-server-to-engine (srv) (let* ((method (gnus-server-to-method srv)) (server (or (assoc 'gnus-search-engine (cddr method)) (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 (cond ((null server) nil) ((eieio-object-p (cadr server)) (cadr server)) ((class-p (cadr server)) (make-instance (cadr server))) (t nil)))) (if inst (when (cddr server) (pcase-dolist (`(,key ,value) (cddr server)) (condition-case nil (setf (slot-value inst key) value) ((invalid-slot-name invalid-slot-type) (nnheader-message 5 "Invalid search engine parameter: (%s %s)" key value))))) (nnheader-message 5 "No search engine defined for %s" srv)) inst))