Re: [RFC] vim plugin rewrite II
authorAnton Khirnov <anton@khirnov.net>
Wed, 2 May 2012 20:23:40 +0000 (22:23 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:46:53 +0000 (09:46 -0800)
79/48fd00a4b2ecd065cb54596099b2bff776d2cd [new file with mode: 0644]

diff --git a/79/48fd00a4b2ecd065cb54596099b2bff776d2cd b/79/48fd00a4b2ecd065cb54596099b2bff776d2cd
new file mode 100644 (file)
index 0000000..4ca6f38
--- /dev/null
@@ -0,0 +1,169 @@
+Return-Path: <anton@khirnov.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id A7EC6431FAF\r
+       for <notmuch@notmuchmail.org>; Wed,  2 May 2012 13:23:47 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id QH-oMbyueZDC for <notmuch@notmuchmail.org>;\r
+       Wed,  2 May 2012 13:23:46 -0700 (PDT)\r
+Received: from smtp1.kolej.mff.cuni.cz (smtp1.kolej.mff.cuni.cz\r
+       [78.128.192.10])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id C7E14431FAE\r
+       for <notmuch@notmuchmail.org>; Wed,  2 May 2012 13:23:45 -0700 (PDT)\r
+X-Envelope-From: anton@khirnov.net\r
+Received: from daenerys.khirnov.net (zohar.kolej.mff.cuni.cz [78.128.198.199])\r
+       by smtp1.kolej.mff.cuni.cz (8.14.4/8.14.4) with ESMTP id\r
+       q42KNeZe083184; Wed, 2 May 2012 22:23:41 +0200 (CEST)\r
+       (envelope-from anton@khirnov.net)\r
+Received: from daenerys.khirnov.net (localhost [127.0.0.1])\r
+       by daenerys.khirnov.net (Postfix) with ESMTP id 40707121840;\r
+       Wed,  2 May 2012 22:23:40 +0200 (CEST)\r
+Content-Type: text/plain; charset="utf-8"\r
+MIME-Version: 1.0\r
+Content-Transfer-Encoding: quoted-printable\r
+User-Agent: notmuch-vimpy\r
+Message-ID: <20120502202340.4214.21470@daenerys.khirnov.net>\r
+Date: Wed, 02 May 2012 22:23:40 +0200\r
+From: Anton Khirnov <anton@khirnov.net>\r
+To: Felipe Contreras <felipe.contreras@gmail.com>\r
+References: <20120114075443.27927.39754@daenerys.khirnov.net>\r
+       <CAMP44s0h=RLNfcs-rLZofMVE88jgQ5KAnfsHNiK9snJi4ctmyw@mail.gmail.com>\r
+       <CAMP44s26n0GgCf3nKawj52+aTFPFmPaA1K3sWLKSXv8KUcabOg@mail.gmail.com>\r
+       <CAMP44s0dKJduJs=N-1OqMRZRGyB+GPQXWnbNwBnK0BH7RKxX_g@mail.gmail.com>\r
+In-Reply-To:\r
+ <CAMP44s0dKJduJs=N-1OqMRZRGyB+GPQXWnbNwBnK0BH7RKxX_g@mail.gmail.com>\r
+Subject: Re: [RFC] vim plugin rewrite II\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 02 May 2012 20:23:47 -0000\r
+\r
+\r
+Hi,\r
+sorry for the late reply, I see you already reached the same point as\r
+me, except with ruby ;) Yay for competition.\r
+\r
+On Thu, 19 Apr 2012 19:36:56 +0300, Felipe Contreras <felipe.contreras@gmai=\r
+l.com> wrote:\r
+> On Wed, Apr 18, 2012 at 5:42 PM, Felipe Contreras\r
+> <felipe.contreras@gmail.com> wrote:\r
+> > On Wed, Apr 18, 2012 at 5:21 PM, Felipe Contreras\r
+> > <felipe.contreras@gmail.com> wrote:\r
+> >> On Sat, Jan 14, 2012 at 9:54 AM, =C2=A0<anton@khirnov.net> wrote:\r
+> >>> branch vim. Simply copy vim/plugin/{nm_vim.py,notmuch-vimpy.vim} to t=\r
+he\r
+> >>> vim plugins dir and vim/syntax/{nm_vimpy*} to the vim syntax dir and =\r
+run\r
+> >>> :NMVimpy() in vim. You'll need vim with python support and\r
+> >>> python-notmuch bindings.\r
+> >>\r
+> >> I gave this a try, copying those files makes vim crash for me.\r
+> >>\r
+> >> I probably need to install notmuch's python bindings, but either way\r
+> >> it shouldn't crash.\r
+> >\r
+> > All right, with the bindings it works, but if it cannot find the\r
+> > database, it crashes too.\r
+> >\r
+> > And this slows by 5 times the startup time of vim for me:\r
+> >\r
+> > vim -c 'quit' =C2=A00.47s user 0.02s system 99% cpu 0.501 total\r
+> > vim -c 'quit' =C2=A00.08s user 0.01s system 96% cpu 0.092 total\r
+> >\r
+> > It is interesting, but I personally I would not use if it's going to\r
+> > slow vim for everything else, there must be a way to solve that. Also,\r
+> > would be nice if you rebased your branch on top of the latest release.\r
+> =\r
+\r
+> I fixed the issue this way:\r
+> =\r
+\r
+> --- notmuch-vimpy.vim        2012-04-18 22:38:16.193358898 +0300\r
+> +++ notmuch-vimpy-mod.vim    2012-04-19 17:07:19.390693437 +0300\r
+> @@ -29,11 +29,7 @@\r
+>      finish\r
+>  endif\r
+> =\r
+\r
+> -" init the python layer\r
+> -let s:python_path =3D expand('<sfile>:p:h')\r
+> -python import sys\r
+> -exec "python sys.path +=3D [r'" . s:python_path . "']"\r
+> -python import vim, nm_vim\r
+> +let s:notmuch_loaded =3D 1\r
+> =\r
+\r
+>  command! NMVimpy call NMVimpy()\r
+> =\r
+\r
+> @@ -815,7 +811,11 @@\r
+>  " --- command handler {{{1\r
+> =\r
+\r
+>  function! NMVimpy()\r
+> -    call <SID>NM_cmd_folders(g:nm_vimpy_folders)\r
+> +    let s:python_path =3D expand('<sfile>:p:h')\r
+> +    python import sys\r
+> +    exec "python sys.path +=3D [r'" . s:python_path . "']"\r
+> +    python import vim, nm_vim\r
+> +    call <SID>NM_cmd_folders(g:nm_vimpy_folders)\r
+>  endfunction\r
+> =\r
+\r
+>  "Custom foldtext() for show buffers, which indents folds to\r
+> @@ -859,5 +859,3 @@\r
+>      python nm_vim.vim_get_tags()\r
+>      return prefix . substitute(taglist, "\n", "\n" . prefix, "g")\r
+>  endfunction\r
+> -\r
+> -let s:notmuch_loaded =3D 1\r
+> =\r
+\r
+\r
+Thanks, looks good.\r
+\r
+> I was seriously considering to concentrate on this plugin instead of\r
+> the current one, but I'm afraid every little error causes a crash,\r
+> even when a subprocess fails (e.g. msmtp), so it's not really usable\r
+> for me. Not to mention that it's really hard to debug, because every\r
+> bug causes a crash, and sometimes I get random crashes with no\r
+> information about what caused it at all.\r
+> =\r
+\r
+> I am starting to work on a version that uses ruby, and it doesn't seem\r
+> to have these issues, but lets see. I'm still not sure if we should\r
+> depend on ruby/python bindings, maybe there's a way to make them\r
+> optional.\r
+> =\r
+\r
+> Anyway, if you find a way to improve the crash issues, let me know, so\r
+> far it's the only real issue I see with this plug-in.\r
+\r
+That is weird, I'm not getting any crashes here. On any exception in the\r
+python code it prints the backtrace and continues normally. I don't\r
+think I've ever seen it actually crash (not counting my ultimately\r
+unsuccessfull attempts at threading). I wonder what could cause this.\r
+\r
+-- =\r
+\r
+Anton Khirnov\r