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=-2.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 25357 invoked from network); 15 Apr 2022 16:15:31 -0000 Received: from mx1.math.uh.edu (129.7.128.32) by inbox.vuxu.org with ESMTPUTF8; 15 Apr 2022 16:15:31 -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.2) (envelope-from ) id 1nfObY-006Xil-8Z for ml@inbox.vuxu.org; Fri, 15 Apr 2022 11:15:28 -0500 Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.94.2) (envelope-from ) id 1nfObX-007Qjv-El for ml@inbox.vuxu.org; Fri, 15 Apr 2022 11:15:27 -0500 Received: from mx1.math.uh.edu ([129.7.128.32]) by lists1.math.uh.edu with esmtp (Exim 4.94.2) (envelope-from ) id 1nfObV-007Qjo-OT for ding@lists.math.uh.edu; Fri, 15 Apr 2022 11:15:25 -0500 Received: from quimby.gnus.org ([95.216.78.240]) by mx1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nfObT-006XiT-Bx for ding@lists.math.uh.edu; Fri, 15 Apr 2022 11:15:25 -0500 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:References :Message-ID:Date:Subject:From:To:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=aOc9FqU9kwZkYbvBpktf+nbdE7FbmzH/y9dEsvE10/Y=; b=X2mRlD02eblNvI+G513jpTXzLD nwjgmNvAMTN5IRLc1ach4sWDt71+FHx/pvvvrQAUTDX4R2gtIdip8L0NuTGiB/Sn/9BBR+nmoCd6x x+J9KqlB71SaUhNGMFIjQDC27K6jHzCzV8BzC7aIi5TaEPLFWsjkXALuCwgKJsD6bXQQ=; Received: from ciao.gmane.io ([116.202.254.214]) by quimby.gnus.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nfObL-0004Lx-OL for ding@gnus.org; Fri, 15 Apr 2022 18:15:18 +0200 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1nfObJ-0008GA-ME for ding@gnus.org; Fri, 15 Apr 2022 18:15:13 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: ding@gnus.org From: Eric Abrahamsen Subject: Re: [Laura Conrad] Re: Notmuch as search engine Date: Fri, 15 Apr 2022 09:14:58 -0700 Message-ID: <8735iegw71.fsf@ericabrahamsen.net> References: <87pmlm14rl.fsf@laymusic.org> <87h76x52ej.fsf@ericabrahamsen.net> <87pmlj39ko.fsf@laymusic.org> <87pmljh74b.fsf@ucl.ac.uk> <87fsmf9wb8.fsf@laymusic.org> <87h76vgw7a.fsf@ucl.ac.uk> <87pmljtgte.fsf@laymusic.org> <87bkx3gqjt.fsf@ericabrahamsen.net> <87lew7t2jq.fsf@laymusic.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cancel-Lock: sha1:tLCm4prZG27hIjVxAiC8ejCWSJ4= List-ID: Precedence: bulk Laura Conrad writes: >>>>>> "Eric" == Eric Abrahamsen writes: > > Eric> Laura Conrad writes: > >>>>>>> "Eric" == Eric S Fraga writes: > >> > Eric> On Thursday, 14 Apr 2022 at 17:42, Laura Conrad wrote: > >> >> (setq gnus-select-method '(nnml "private" (gnus-search-engine > >> > notmuch))) > >> > Eric> But if you are using nnir, maybe try what I had, i.e. > >> > Eric> (setq gnus-select-method '(nnml "private" > Eric> (nnir-search-engine notmuch))) > >> > Eric> as this was what I had and it worked? > >> > >> Well, that doesn't work for me either. I still get: > >> > >> gnus-select-newsgroup: Couldn’t request group nnir:nnir-87tuavth0w.fsf: > >> Search produced empty results. > >> > >> Whereas from the command line: > >> > >> notmuch search --format=text --output=files scuttle > >> > >> produces lots of nice results like: > >> > >> /home/lconrad/Mail/laymusic/87119 > >> /home/lconrad/Mail/ding/31033 > >> /home/lconrad/Mail/sent/32975 > >> /home/lconrad/Mail/ding/31032 > >> /home/lconrad/Mail/sent/32974 > >> /home/lconrad/Mail/laymusic/87120 > >> /home/lconrad/Mail/laymusic/87119 > > Eric> And `nnir-notmuch-remove-prefix' is set to "/home/lconrad/Mail"? It > Eric> should be, that would be the default... > > Yes. If notmuch is actually returning an error, which I suspect it isn't, you can set `gnus-verbose' to something higher than 6, and it will show you the buffer with the error message. If (as I suspect) that doesn't do anything, try evaluating this version of `nnir-run-notmuch'. It should pop up a buffer showing you the results of the notmuch call, and put some messages in the *Messages* buffer about the parsing of individual search results. (defun nnir-run-notmuch (query server &optional groups) "Run QUERY against notmuch. Returns a vector of (group name, file name) pairs (also vectors, actually). If GROUPS is a list of group names, use them to construct path: search terms (see the variable `nnir-notmuch-filter-group-names-function')." (save-excursion (let* ((qstring (cdr (assq 'query query))) (prefix (nnir-read-server-parm 'nnir-notmuch-remove-prefix server)) artlist (article-pattern (if (string-match "\\`nnmaildir:" (gnus-group-server server)) ":[0-9]+" "^[0-9]+$")) (groups (when nnir-notmuch-filter-group-names-function (delq nil (mapcar nnir-notmuch-filter-group-names-function (mapcar #'gnus-group-short-name groups))))) (pathquery (when groups (concat " (" (mapconcat (lambda (g) (format "path:%s" g)) groups " or") ")"))) artno dirnam filenam) (when (equal "" qstring) (error "notmuch: You didn't enter anything")) (set-buffer (get-buffer-create nnir-tmp-buffer)) (erase-buffer) (if groups (message "Doing notmuch query %s on %s..." qstring (mapconcat #'identity groups " ")) (message "Doing notmuch query %s..." qstring)) (when groups (setq qstring (concat qstring pathquery))) (let* ((cp-list `( ,nnir-notmuch-program nil ; input from /dev/null t ; output nil ; don't redisplay "search" "--format=text" "--output=files" ,@(nnir-read-server-parm 'nnir-notmuch-additional-switches server) ,qstring ; the query, in notmuch format )) (exitstatus (progn (message "%s args: %s" nnir-notmuch-program (mapconcat #'identity (nthcdr 4 cp-list) " ")) ;; ??? (apply #'call-process cp-list)))) (unless (or (null exitstatus) (zerop exitstatus)) (nnheader-report 'nnir "Couldn't run notmuch: %s" exitstatus))) (display-buffer nnir-tmp-buffer) ;; The results are output in the format of: ;; absolute-path-name (goto-char (point-min)) (while (not (eobp)) (setq filenam (buffer-substring-no-properties (line-beginning-position) (line-end-position)) artno (file-name-nondirectory filenam) dirnam (file-name-directory filenam)) (forward-line 1) (message "Directory/group: %s; article number %s" dirnam artno) ;; don't match directories (when (string-match article-pattern artno) (when (not (null dirnam)) (message "Accepting result %s : %s" dirnam artno) (nnir-add-result dirnam artno "" prefix server artlist)))) (message "Massaging notmuch output...done") artlist)))