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 912016DE0352 for ; Sun, 4 Jun 2017 08:48:14 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.863 X-Spam-Level: X-Spam-Status: No, score=-0.863 tagged_above=-999 required=5 tests=[AWL=0.049, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.211, SPF_PASS=-0.001] 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 Krzcuj3xdzLK for ; Sun, 4 Jun 2017 08:48:13 -0700 (PDT) Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by arlo.cworth.org (Postfix) with ESMTPS id 206776DE01C2 for ; Sun, 4 Jun 2017 08:48:13 -0700 (PDT) Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id CE87A20B5E for ; Sun, 4 Jun 2017 17:48:08 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 3wgj5g1TD9z105q; Sun, 4 Jun 2017 17:48:06 +0200 (CEST) From: Tomas Nordin To: David Bremner , notmuch@notmuchmail.org Subject: Re: Semi-ready saved search In-Reply-To: <87y3te6y2h.fsf@tesseract.cs.unb.ca> References: <8760hfit9r.fsf@flaptop.tomnor.org> <87y3te6y2h.fsf@tesseract.cs.unb.ca> Date: Sun, 04 Jun 2017 17:48:06 +0200 Message-ID: <87wp8rdaa1.fsf@fliptop> 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: Sun, 04 Jun 2017 15:48:14 -0000 David Bremner writes: > 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. Thank you. I could easily re-shape this to behave as I want: (defun non-list-for-days-search(arg) (interactive "nNon-list mails during this many days: ") (notmuch-search (format "date:%dd.. and not tag:rfile" arg))) (define-key notmuch-hello-mode-map (kbd "S") 'non-list-for-days-search)