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 3727 invoked from network); 5 Nov 2020 16:15:25 -0000 Received: from mx1.math.uh.edu (129.7.128.32) by inbox.vuxu.org with ESMTPUTF8; 5 Nov 2020 16:15:25 -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 1kahuH-00Ejtv-Jp; Thu, 05 Nov 2020 10:14:37 -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 1kahuH-0093uR-1d; Thu, 05 Nov 2020 10:14:37 -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 1kahuD-0093sb-1U for ding@lists.math.uh.edu; Thu, 05 Nov 2020 10:14:33 -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 1kahuA-003mZy-Kr for ding@lists.math.uh.edu; Thu, 05 Nov 2020 10:14:32 -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=SvUdoNONTxSEUbhg+vHasYAV8HrBBPGgIjOx/U6OpGs=; b=jykDbVK/LY3ksOd+Aw8hh+w880 k95WWrj98zKeGzgnizVDaqSbZShyhqwkJ7OaLe7gg3D4ZqQo3j+Bpg0uarkmnvOo3+GOhjy9LR/45 pBbQNmhSk+VFuTwDBbJDy+W+m7sEnKUVqdGKq+VqLFVkiYTPuuc/OLOpjRh0LyJAvFZ8=; 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 1kahu4-0004UE-6k for ding@gnus.org; Thu, 05 Nov 2020 17:14:26 +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 EE543FA16E; Thu, 5 Nov 2020 16:14:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1604592862; bh=SvUdoNONTxSEUbhg+vHasYAV8HrBBPGgIjOx/U6OpGs=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=FgOztYbXRx1EIfKvSEdWEQGPAArSeY//H/dqk1hAhHAifJlGOjVEM4BShQ6QPUTcT Brq77QkPItFvqWqxRnnnz5U/B3QtIes+yqdrGNgngCluIHy6vaoDHBqTUlGna+J9wr xb4TBFdi9gCeo8qIKnt1s+sJqUukM04LVs33HfTE= 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> <87o8kb94e1.fsf@ericabrahamsen.net> Date: Thu, 05 Nov 2020 08:14:20 -0800 In-Reply-To: <87o8kb94e1.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Thu, 05 Nov 2020 08:04:22 -0800") Message-ID: <87k0uz93xf.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 Eric Abrahamsen writes: > 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)) This is wrong too, let me just take a deep breath and do this right...