From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/86628 Path: news.gmane.org!not-for-mail From: myglc2 Newsgroups: gmane.emacs.gnus.general Subject: Re: notmuch is limited to a single local mail store, right? Date: Fri, 15 Jan 2016 22:47:52 -0500 Message-ID: <87h9iedw2f.fsf@gmail.com> References: <87bn8n1sdq.fsf@gmail.com> <87lh7rif52.fsf@tullinup.koldfront.dk> <87k2nbhuqa.fsf@gmail.com> <8760yubnl7.fsf@tullinup.koldfront.dk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1452916280 3618 80.91.229.3 (16 Jan 2016 03:51:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 16 Jan 2016 03:51:20 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M34855@lists.math.uh.edu Sat Jan 16 04:51:08 2016 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from lists1.math.uh.edu ([129.7.128.208]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aKHtL-0008HU-4H for ding-account@gmane.org; Sat, 16 Jan 2016 04:51:07 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.85) (envelope-from ) id 1aKHsA-0005DN-Q8; Fri, 15 Jan 2016 21:49:54 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by lists1.math.uh.edu with esmtps (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.85) (envelope-from ) id 1aKHs7-0005Cx-Ag for ding@lists.math.uh.edu; Fri, 15 Jan 2016 21:49:51 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.85) (envelope-from ) id 1aKHs5-0006Oo-40 for ding@lists.math.uh.edu; Fri, 15 Jan 2016 21:49:51 -0600 Original-Received: from plane.gmane.org ([80.91.229.3]) by quimby.gnus.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1aKHs1-000695-QX for ding@gnus.org; Sat, 16 Jan 2016 04:49:45 +0100 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aKHs1-0007DH-8m for ding@gnus.org; Sat, 16 Jan 2016 04:49:45 +0100 Original-Received: from c-73-167-118-254.hsd1.ma.comcast.net ([73.167.118.254]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 16 Jan 2016 04:49:45 +0100 Original-Received: from myglc2 by c-73-167-118-254.hsd1.ma.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 16 Jan 2016 04:49:45 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 159 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-73-167-118-254.hsd1.ma.comcast.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:vUyGQnFSsE1QQK/yIfP2wm7d8ew= X-Spam-Score: -1.8 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:86628 Archived-At: Peter Münster writes: > On Fri, Jan 15 2016, myglc2 wrote: > >> notmuch does not support making more than one index. > > What about: > NOTMUCH_CONFIG=here notmuch > NOTMUCH_CONFIG=there notmuch > ? asjo@koldfront.dk (Adam Sjøgren) writes: > On Fri, Jan 15 2016, myglc2 wrote: > >> notmuch does not support making more than one index. > > I think you are overinterpreting in this statement. OOPS! Hey, many thanks for straightening me out on this. So... I tried passing notmuch config in as a switch like so ... ;; notmuch on 2nd test maildir folder (add-to-list 'gnus-secondary-select-methods '(nnmaildir "foobar.2" (directory "~/Maildir/foobar.2") (nnir-search-engine notmuch) (nnir-notmuch-remove-prefix "/home/glc/Maildir/foobar.2/") (nnir-notmuch-additional-switches '("--config=/home/glc/.notmuch-config.2") ) ) ) ... and discovered two issues. When I followed the help setting the switches ... ;; nnir-notmuch-additional-switches is a variable defined in ‘nnir.el’. ;; Its value is nil ;; ;; Documentation: ;; *A list of strings, to be given as additional arguments to notmuch. ;; ;; Note that this should be a list. I.e., do NOT use the following: ;; (setq nnir-notmuch-additional-switches "-i -w") ; wrong ;; Instead, use this: ;; (setq nnir-notmuch-additional-switches '("-i" "-w")) ... there was a spurious 'quote( )' passed to notmuch. So ... I removed the leading quote, and the argument list shown in the message buffer looked better. So maybe the help should be changed to read ... ;; Instead, use this: ;; (setq nnir-notmuch-additional-switches ("-i" "-w")) However, The order in which the additional switches are passed ... notmuch args: search --format=text --output=files --config=/home/glc/.notmuch-config.2 olivia Massaging notmuch output...done Search produced empty results. ... and as constructed by this nnir.el code ... (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 )) ... made notmuch unhappy. So I 'fixed' nnir-run-notmuch by changing the order ... (let* ((cp-list `( ,nnir-notmuch-program nil ; input from /dev/null t ; output nil ; don't redisplay ,@(nnir-read-server-parm 'nnir-notmuch-additional-switches server) "search" "--format=text" "--output=files" ,qstring ; the query, in notmuch format )) ... which made notmuch happy ... notmuch args: --config=/home/glc/.notmuch-config.2 search --format=text --output=files olivia Massaging notmuch output...done So... Bottom line, a gnus config like this ... ;; notmuch on 2nd test maildir folder (add-to-list 'gnus-secondary-select-methods '(nnmaildir "foobar.2" (directory "~/Maildir/foobar.2") (nnir-search-engine notmuch) (nnir-notmuch-program "notmuch") (nnir-notmuch-remove-prefix "/home/glc/Maildir/foobar.2/") (nnir-notmuch-additional-switches ("--config=/home/glc/.notmuch-config.2") ) ) ) ... with the minor change to nnir.el shown above, allows multiple notmuch indexes. BTW, I also tried the 'NOTMUCH_CONFIG=here notmuch' scheme suggested by Peter hoping it might not require any code changes. I tried this ... ;; notmuch on 3rdd test maildir folder (add-to-list 'gnus-secondary-select-methods '(nnmaildir "foobar.3" (directory "~/Maildir/foobar.3") (nnir-search-engine notmuch) ;; Note: this fails because 'call-process' ;; punts on the environmental var (nnir-notmuch-program "NOTMUCH_CONFIG=${HOME}/.notmuch-config.3 notmuch") (nnir-notmuch-remove-prefix "/home/glc/Maildir/foobar.3/") ) ) But I discovered that a global value of nnir-notmuch-program is used by nnir-run-notmuch. I did a little hack to pick up the server-specific value like so ... (let* ((cp-list `(,(nnir-read-server-parm 'nnir-notmuch-program server) nil ; input from /dev/null t ; output nil ; don't redisplay ,@(nnir-read-server-parm 'nnir-notmuch-additional-switches server) "search" "--format=text" "--output=files" ,qstring ; the query, in notmuch format )) ... but then ... (apply 'call-process cp-list)))) ... produced this error ... c-append-to-state-cache: Searching for program: No such file or directory, NOTMUCH_CONFIG=${HOME}/.notmuch-config.3 notmuch So... how do one pass an environmental from an init file into a process? Many thanks, - George