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 C207C431FC1 for ; Fri, 9 Apr 2010 06:11:02 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.301 X-Spam-Level: X-Spam-Status: No, score=-2.301 tagged_above=-999 required=5 tests=[BAYES_20=-0.001, RCVD_IN_DNSWL_MED=-2.3] autolearn=ham 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 t4IypQPjmAgZ for ; Fri, 9 Apr 2010 06:11:01 -0700 (PDT) Received: from ipex2.johnshopkins.edu (ipex2.johnshopkins.edu [162.129.8.151]) by olra.theworths.org (Postfix) with ESMTP id B15F44196F2 for ; Fri, 9 Apr 2010 06:11:01 -0700 (PDT) X-IronPort-AV: E=Sophos;i="4.52,177,1270440000"; d="scan'208";a="319959808" Received: from unknown (HELO gogo) ([12.236.65.28]) by ipex2.johnshopkins.edu with ESMTP/TLS/AES256-SHA; 09 Apr 2010 09:11:01 -0400 Received: from jkr by gogo with local (Exim 4.69) (envelope-from ) id 1O0EvE-0000h8-Ru; Fri, 09 Apr 2010 10:11:00 -0400 From: Jesse Rosenthal To: Carl Worth , notmuch@notmuchmail.org Subject: Re: [notmuch] [PATCH v2] notmuch.el: add functionality in notmuch search mode to add or remove tags by region In-Reply-To: <87aatfq88h.fsf@yoom.home.cworth.org> References: <87sk90ragj.fsf@jhu.edu> <87aatfq88h.fsf@yoom.home.cworth.org> Date: Fri, 09 Apr 2010 10:11:00 -0400 Message-ID: <877hogaf7v.fsf@jhu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: Fri, 09 Apr 2010 13:11:02 -0000 On Wed, 07 Apr 2010 14:10:38 -0700, Carl Worth wrote: > On Tue, 16 Feb 2010 19:07:40 -0500, Jesse Rosenthal wrote: > I think this feature is very useful, and that the region is definitely > an appropriate way to implement it, (doing region-based operations is > very natural for emacs users). Mutt-style marking could be implemented > as well, but that would be separate I think. Great -- never sure if my intuitive use corresponds with that of others. > I also don't like the duplication of code in > notmuch-search-add-tag-thread and notmuch-search-add-tag-region, (and > the same in the remove case). Fortunately, I think this easy to avoid by > simply making notmuch-search-add-tag-thread call: > > (notmuch-search-add-tag-region tag (point) (point)) > > and the same in the remove case. Good idea. > > But I haven't pushed this patch yet for a flaw in the case of selecting > beyond the last thread, (such as selecting to the line that includes the > "End of search results). If I try an operation on that line, it will act > like it works, (it displays the new tags by all threads), but then a > refresh makes them all disappear again. Presumably the "notmuch tag" > command is failing, this isn't being noticed, and the code marches on to > update the representation of the tags. Good point, and shouldn't be too hard to fix. It seems like it could be done either (a) at the lisp level (filtering out the blank entries), or (b) at the literal buffer level (having a step that sets point-max for the region appropriately). The choice (a) seems clearer in an abstract way, but has the downside of needing to be repeated twice (both for database tagging, and for rewriting the tags on the screen). I'll play with both and see which is clearer. Best, Jesse