From 0b8d2b7faa19542ceaa9c10ca9e0f4fbd5616946 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Fri, 10 Aug 2012 10:13:55 +0200 Subject: [PATCH] Re: Vim plugins --- 81/0900bd941fd92206a0b2176b8fae91417adf18 | 142 ++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 81/0900bd941fd92206a0b2176b8fae91417adf18 diff --git a/81/0900bd941fd92206a0b2176b8fae91417adf18 b/81/0900bd941fd92206a0b2176b8fae91417adf18 new file mode 100644 index 000000000..a5636d706 --- /dev/null +++ b/81/0900bd941fd92206a0b2176b8fae91417adf18 @@ -0,0 +1,142 @@ +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 9286C431FAF + for ; Fri, 10 Aug 2012 01:14:30 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + 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 4vA1JvIY54-y for ; + Fri, 10 Aug 2012 01:14:29 -0700 (PDT) +Received: from lain.khirnov.net (lain.khirnov.net [176.97.15.12]) + by olra.theworths.org (Postfix) with ESMTP id D511F431FAE + for ; Fri, 10 Aug 2012 01:14:28 -0700 (PDT) +Received: from localhost (localhost [127.0.0.1]) + by lain.khirnov.net (Postfix) with ESMTP id 32E59C2C4C; + Fri, 10 Aug 2012 10:14:27 +0200 (CEST) +Received: from lain.khirnov.net ([127.0.0.1]) + by localhost (mail.khirnov.net [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id R+A7jgaMfUWh; Fri, 10 Aug 2012 10:14:25 +0200 (CEST) +Received: from daenerys.khirnov.net (unknown + [IPv6:2002:b061:f0a:1:52e5:49ff:fe3d:a3f2]) + by lain.khirnov.net (Postfix) with ESMTP id B45F7C1513; + Fri, 10 Aug 2012 10:14:25 +0200 (CEST) +Received: from daenerys.khirnov.net (localhost [127.0.0.1]) + by daenerys.khirnov.net (Postfix) with ESMTP id 78FBA122CBF; + Fri, 10 Aug 2012 10:13:55 +0200 (CEST) +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: quoted-printable +User-Agent: notmuch-vimpy +Message-ID: <20120810081355.5861.36559@daenerys.khirnov.net> +Date: Fri, 10 Aug 2012 10:13:55 +0200 +References: <1344174764.11525.YahooMailNeo@web171404.mail.ir2.yahoo.com> + <20120806161738.7080.82028@daenerys.khirnov.net> + <1344292148.78234.YahooMailNeo@web171405.mail.ir2.yahoo.com> + <20120807044234.29222.72622@daenerys.khirnov.net> + <1344328502.63480.YahooMailNeo@web171406.mail.ir2.yahoo.com> + <20120807093905.29222.57092@daenerys.khirnov.net> + <1344502159.57334.YahooMailNeo@web171405.mail.ir2.yahoo.com> +To: Sepp Tannhuber , + "notmuch@notmuchmail.org" +In-Reply-To: <1344502159.57334.YahooMailNeo@web171405.mail.ir2.yahoo.com> +From: Anton Khirnov +Subject: Re: Vim plugins +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, 10 Aug 2012 08:14:30 -0000 + + +On Thu, 9 Aug 2012 09:49:19 +0100 (BST), Sepp Tannhuber wrote: +> Dear Anton, +> = + +> for some reason the file did not exist here. Perhaps I deleted it acciden= +tally. So I cloned the +> repository again. And there it is. +> Now I'm trying=C2=A0if it is useful for me. I changed some code that I ca= +n use python-ranger to +> attach files: +> ########## +> function! s:NM_compose_attach() +> = + +> if filereadable('/tmp/chosendir') +> silent !ranger --choosefiles=3D/tmp/chosenfiles --choosedir=3D/tmp/chosen= +dir "$(cat /tmp/chosendir)" +> else +> silent !ranger --choosefiles=3D/tmp/chosenfiles --choosedir=3D/tmp/chosen= +dir +> endif +> if filereadable('/tmp/chosenfiles') +> let attachments =3D readfile('/tmp/chosenfiles') +> call system('rm /tmp/chosenfiles') +> for attach in attachments +> python nm_vim.get_current_buffer().attach(vim.eval('attach')) +> endfor +> call append(10, map(attachments, '"Attach: ".escape(v:val," \t\\")')) +> redraw! +> endif +> endfunction +> ########## +> It's even possible to mark and attach multiple files at once. +> = + + +Looks useful, but needs more work I think. +First, I think it should be a new function, so there are separate +'attach one file'/'attach multiple files' commands. +Second, using hardcoded filenames would break horribly with multiple +instances of the client running. + +> Is it possible suppress the message returned by +> =C2=A0 =C2=A0 python nm_vim.get_current_buffer()? +> =C2=A0 + +What message? + +> And do you have=C2=A0an idea=C2=A0what's the reason for the following mes= +sage? +> = + +> ########## +> :call 33_NM_folders_show_search('') =C2=A0 =C2=A0 =C2=A0 Exception i= +n thread Thread-1: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 +> Traceback (most recent call last): +> =C2=A0 File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_i= +nner +> =C2=A0 =C2=A0 self.run() +> =C2=A0 File "/usr/lib/python2.7/threading.py", line 504, in run +> =C2=A0 =C2=A0 self.__target(*self.__args, **self.__kwargs) +> =C2=A0 File "/home/sepp/.vim/plugin/nm_vim.py", line 195, in _refresh_thr= +ead +> =C2=A0 =C2=A0 authors, subj, tags)).encode('utf-8') +> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: o= +rdinal not in range(128) +> ########## +> = + + +Should be fixed now. + +-- = + +Anton Khirnov -- 2.26.2