Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 20A5A429E57 for ; Sun, 29 Jan 2012 15:17:40 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2NQoA4TsjYbB for ; Sun, 29 Jan 2012 15:17:39 -0800 (PST) Received: from dmz-mailsec-scanner-7.mit.edu (DMZ-MAILSEC-SCANNER-7.MIT.EDU [18.7.68.36]) by olra.theworths.org (Postfix) with ESMTP id 8D441431E64 for ; Sun, 29 Jan 2012 15:17:39 -0800 (PST) X-AuditID: 12074424-b7fae6d000000906-8c-4f25d3932734 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP id 83.31.02310.393D52F4; Sun, 29 Jan 2012 18:17:39 -0500 (EST) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q0TNHduT020974; Sun, 29 Jan 2012 18:17:39 -0500 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q0TNHb39025410 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Sun, 29 Jan 2012 18:17:38 -0500 (EST) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) (envelope-from ) id 1RrdzO-00009M-1l; Sun, 29 Jan 2012 18:16:50 -0500 Date: Sun, 29 Jan 2012 18:16:50 -0500 From: Austin Clements To: Dmitry Kurochkin Subject: Re: [PATCH 1/6] emacs: move tag format validation to `notmuch-tag' function Message-ID: <20120129231650.GK17991@mit.edu> References: <1327725684-5887-1-git-send-email-dmitry.kurochkin@gmail.com> <20120129213427.GF17991@mit.edu> <87fwey86hj.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87fwey86hj.fsf@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmplleLIzCtJLcpLzFFi42IRYrdT1518WdXfYMdVbourW/vZLa7fnMns wOSxc9Zddo9nq24xBzBFcdmkpOZklqUW6dslcGXM3vCEteCqQMWJc++ZGxg7ebsYOTkkBEwk /i9fygZhi0lcuLceyObiEBLYxyjxc8IpdghnA6PEn4OXWSCck0wSc7YvhHKWMEpMuXSbCaSf RUBVYvqEfjCbTUBDYtv+5YwgtoiAocSti6+YQWxmAWmJb7+bwWqEBcIkurafA9vNK6AjMW37 HlaIoZ2MEq9+PmWGSAhKnJz5hAWiWUvixr+XQM0cYIOW/+MACXMKqEtcv90HVi4qoCIx5eQ2 tgmMQrOQdM9C0j0LoXsBI/MqRtmU3Crd3MTMnOLUZN3i5MS8vNQiXXO93MwSvdSU0k2M4NB2 UdnB2HxI6RCjAAejEg+vwgoVfyHWxLLiytxDjJIcTEqivIEXVP2F+JLyUyozEosz4otKc1KL DzFKcDArifDOWQaU401JrKxKLcqHSUlzsCiJ82povfMTEkhPLEnNTk0tSC2CycpwcChJ8D65 BNQoWJSanlqRlplTgpBm4uAEGc4DNPwvSA1vcUFibnFmOkT+FKOilDgvIzB5CAmAJDJK8+B6 YannFaM40CvCvKwgVTzAtAXX/QpoMBPQ4OcMYINLEhFSUg2MLuK/eoxq1vRGOMQeEZntW1Xo tHqVv/8xp0t/rNQcX68wYvy/oic7myvVZV/S8Xx7y8j8n1PvPIoW237e4XqTIFOFlH3VqhcW rhHVb27H+LTPCVfkzWMKEy6tnrV6UVXblrVnnnrl58TOtvtnWvzytTfjygXs0aXdC61/VTJr 76/Sv3XzxiIlluKMREMt5qLiRABleTXIGAMAAA== Cc: notmuch@notmuchmail.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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, 29 Jan 2012 23:17:40 -0000 Quoth Dmitry Kurochkin on Jan 30 at 2:54 am: > Hi Austin. > > On Sun, 29 Jan 2012 16:34:27 -0500, Austin Clements wrote: > > One philosophical nit below, but not enough to hold this up. > > > > Quoth Dmitry Kurochkin on Jan 28 at 8:41 am: > > > Before the change, tag format validation was done in > > > `notmuch-search-operate-all' function only. The patch moves it down > > > to `notmuch-tag', so that all users of that function get input > > > validation. > > > --- > > > emacs/notmuch.el | 12 ++++++------ > > > 1 files changed, 6 insertions(+), 6 deletions(-) > > > > > > diff --git a/emacs/notmuch.el b/emacs/notmuch.el > > > index 72f78ed..84d7d0a 100644 > > > --- a/emacs/notmuch.el > > > +++ b/emacs/notmuch.el > > > @@ -522,6 +522,12 @@ Note: Other code should always use this function alter tags of > > > messages instead of running (notmuch-call-notmuch-process \"tag\" ..) > > > directly, so that hooks specified in notmuch-before-tag-hook and > > > notmuch-after-tag-hook will be run." > > > + ;; Perform some validation > > > + (when (null tags) (error "No tags given")) > > > > Since this is a non-interactive function and hence is meant to be > > invoked programmatically, I would expect it to accept zero tags. > > Unlike the following check, this is a UI-level check and thus, I > > believe, belongs in interactive functions (even if that requires a > > little duplication). > > > > Agreed. Though I would hate to add the same check to each tag > operation. Perhaps this check can go to > `notmuch-select-tags-with-completion'? > > This is not the main patch in the series. So I think I would prefer not > to make v2 because of this issue. If we come up with a good (i.e. no > duplication) solution, I will prepare a separate patch for it. What about not giving any error for no tags? As a user, if I delete the whole tags prompt including the +/- operator, that's a very explicit action and it's very clear what it should do (nothing). I don't need Emacs wagging its finger at me for doing something with a clear meaning.