From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id D0ED7431FD0 for ; Sun, 10 Jul 2011 22:40:42 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.699 X-Spam-Level: X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, 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 09Cns2JoiLww for ; Sun, 10 Jul 2011 22:40:42 -0700 (PDT) Received: from mail-vw0-f53.google.com (mail-vw0-f53.google.com [209.85.212.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 86F65429E28 for ; Sun, 10 Jul 2011 22:40:38 -0700 (PDT) Received: by mail-vw0-f53.google.com with SMTP id 13so2781810vws.26 for ; Sun, 10 Jul 2011 22:40:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:subject:date:message-id:x-mailer:in-reply-to :references; bh=2/TmYZBCXLh9E2JL1NmT2ReNy4ZTiBXUIOY8kq6PU4s=; b=KcYPhuZW3FXoZBeqF5xTNoxtZeuHf6HQXo6xZhDhdIoobHadonS7RP8ZKQYyLwTOcD ODLc8EjOSO5Ya7ONwQZHUlInvRB36YuVSzOS/ZiFaVZUMvojidLn1liBeqEs/w3R4SN9 Rp5Jtwaa5S8SrpQdDwWIZcAWpomVp6+LkYP3o= Received: by 10.52.24.43 with SMTP id r11mr1892675vdf.529.1310362838298; Sun, 10 Jul 2011 22:40:38 -0700 (PDT) Received: from localhost.localdomain (c-98-216-100-90.hsd1.ma.comcast.net [98.216.100.90]) by mx.google.com with ESMTPS id bl2sm5324172vbb.9.2011.07.10.22.40.37 (version=SSLv3 cipher=OTHER); Sun, 10 Jul 2011 22:40:38 -0700 (PDT) Sender: Jason Woofenden From: Jason Woofenden To: notmuch@notmuchmail.org Subject: [PATCH 4/5] vim: fix (hack) cig/cit parsing within multipart/* Date: Mon, 11 Jul 2011 01:40:09 -0400 Message-Id: <1310362810-10926-5-git-send-email-jason@jasonwoof.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1310362810-10926-1-git-send-email-jason@jasonwoof.com> References: <1310362810-10926-1-git-send-email-jason@jasonwoof.com> 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: Mon, 11 Jul 2011 05:40:43 -0000 The vim front-end isn't written to handle nested parts. This patch doesn't change that, it just changes the code to pretend that multipart/* sections end immediately. This makes the parsing code think that all sections are top-level, and are thus parsed well enough. The lovely result of this is that citation folds and signature folds now work in text/plain parts that are within multipart/* sections. Also, all mime section starts are now shown correctly (before some were not parsed and showed the ugly ^L and an ID and so on from notmuch.) --- vim/plugin/notmuch.vim | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/vim/plugin/notmuch.vim b/vim/plugin/notmuch.vim index 3982008..2095547 100644 --- a/vim/plugin/notmuch.vim +++ b/vim/plugin/notmuch.vim @@ -796,7 +796,14 @@ function! s:NM_cmd_show_parse(inlines) endif call add(info['disp'], \ printf('--- %s ---', in_part)) - let part_start = len(info['disp']) + 1 + " We don't yet handle nested parts, so pop + " multipart/* immediately so text/plain + " sub-parts are parsed properly + if match(in_part, '^multipart/') != -1 + let in_part = '' + else + let part_start = len(info['disp']) + 1 + endif endif elseif in_header -- 1.7.5.4