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 7D860429E5F for ; Tue, 17 Jan 2012 22:54:45 -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 sUhvKdPM1By4 for ; Tue, 17 Jan 2012 22:54:44 -0800 (PST) Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 6BE96429E27 for ; Tue, 17 Jan 2012 22:54:44 -0800 (PST) Received: by wgbdr13 with SMTP id dr13so2027271wgb.2 for ; Tue, 17 Jan 2012 22:54:41 -0800 (PST) Received: by 10.180.104.5 with SMTP id ga5mr28717602wib.21.1326869681576; Tue, 17 Jan 2012 22:54:41 -0800 (PST) Received: from hotblack-desiato.hh.sledj.net (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25]) by mx.google.com with ESMTPS id em13sm20798658wid.7.2012.01.17.22.54.39 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 17 Jan 2012 22:54:40 -0800 (PST) Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000) id 2FEF1A0A7A; Wed, 18 Jan 2012 06:54:38 +0000 (GMT) To: Adam Wolfe Gordon , notmuch Subject: Re: [PATCH v2 4/5] emacs: Use the new JSON reply format. In-Reply-To: <1326840818-6821-1-git-send-email-awg+notmuch@xvx.ca> References: <1326840818-6821-1-git-send-email-awg+notmuch@xvx.ca> User-Agent: Notmuch/0.11+64~g42e8f66 (http://notmuchmail.org) Emacs/24.0.92.1 (x86_64-pc-linux-gnu) From: David Edmondson Date: Wed, 18 Jan 2012 06:54:34 +0000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" 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: Wed, 18 Jan 2012 06:54:46 -0000 --=-=-= Content-Type: text/plain On Tue, 17 Jan 2012 15:53:37 -0700, Adam Wolfe Gordon wrote: > +(defun notmuch-parts-filter-by-type (parts type) > + "Return a list of message parts with the given type" > + (let (result) > + (dolist (part (append parts nil) result) > + (if (string= (cdr (assq 'content-type part)) type) > + (setq result (append result (list (cdr (assq 'content part))))))) > + result)) I still think that `loop' is easier to read :-) But no objection to this code. > +(defun notmuch-mua-insert-part-quoted (part) > + (let ((start (point)) > + limit) > + (insert part) > + (setq limit (point)) > + (goto-char start) > + (while (re-search-forward "\\(^\\)[^$]" limit 0) > + (replace-match "> " nil nil nil 1) > + ;; We have added two characters to the quotable region > + (setq limit (+ limit 2))) > + (set-buffer-modified-p nil))) You could use a marker for the limit, as it would then move along automagically (sorry for not noticing this last time). --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk8WbKoACgkQaezQq/BJZRaIOwCfWBzhCeYDQngWBitS5Ownuxl2 lGsAnjRw1bCYKz5fr7lvKSzcLqFG6EZI =HDkg -----END PGP SIGNATURE----- --=-=-=--