From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 907DB6DE0173 for ; Tue, 30 May 2017 10:42:40 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.001 X-Spam-Level: X-Spam-Status: No, score=-0.001 tagged_above=-999 required=5 tests=[AWL=0.010, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E_xR-Lxm8UDk for ; Tue, 30 May 2017 10:42:38 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 57D116DE0140 for ; Tue, 30 May 2017 10:42:38 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.84_2) (envelope-from ) id 1dFl9E-0003LQ-Ks; Tue, 30 May 2017 13:41:36 -0400 Received: (nullmailer pid 28168 invoked by uid 1000); Tue, 30 May 2017 17:42:30 -0000 From: David Bremner To: Tomas Nordin , notmuch@notmuchmail.org Subject: Re: Semi-ready saved search In-Reply-To: <8760hfit9r.fsf@flaptop.tomnor.org> References: <8760hfit9r.fsf@flaptop.tomnor.org> Date: Tue, 30 May 2017 14:42:30 -0300 Message-ID: <87y3te6y2h.fsf@tesseract.cs.unb.ca> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 17:42:40 -0000 Tomas Nordin writes: > Hello Notmuchers > > What is a good way (with emacs) to hook into the search to modify only a > part of a search term. I find myself often doing this: > > date:2d.. not is:rfile > > rfile is my tag for mails that i archive locally. I am looking for a way > to query myself only for the number of days in the minibuffer. I use > this search to filter off all mailing list stuff from a search. So, in > the above example I would only have to answer 2 . One approach would be to define a function like this (defun last-days-search(arg) (interactive "p") (notmuch-search (format "date:%dd.. and tag:inbox" arg))) Then you can pass a numeric argument in the usual emacs way, e.g. if that function is bound to C-c d, ESC 2 C-c d will give you two days.