From: Anton Khirnov <anton@khirnov.net>
To: Sepp Tannhuber <sepp.tannhuber@yahoo.de>,
"notmuch@notmuchmail.org" <notmuch@notmuchmail.org>
Subject: Re: Vim plugins
Date: Fri, 10 Aug 2012 10:13:55 +0200 [thread overview]
Message-ID: <20120810081355.5861.36559@daenerys.khirnov.net> (raw)
In-Reply-To: <1344502159.57334.YahooMailNeo@web171405.mail.ir2.yahoo.com>
On Thu, 9 Aug 2012 09:49:19 +0100 (BST), Sepp Tannhuber <sepp.tannhuber@yahoo.de> wrote:
> Dear Anton,
>
> for some reason the file did not exist here. Perhaps I deleted it accidentally. So I cloned the
> repository again. And there it is.
> Now I'm trying if it is useful for me. I changed some code that I can use python-ranger to
> attach files:
> ##########
> function! s:NM_compose_attach()
>
> if filereadable('/tmp/chosendir')
> silent !ranger --choosefiles=/tmp/chosenfiles --choosedir=/tmp/chosendir "$(cat /tmp/chosendir)"
> else
> silent !ranger --choosefiles=/tmp/chosenfiles --choosedir=/tmp/chosendir
> endif
> if filereadable('/tmp/chosenfiles')
> let attachments = 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
> python nm_vim.get_current_buffer()?
>
What message?
> And do you have an idea what's the reason for the following message?
>
> ##########
> :call <SNR>33_NM_folders_show_search('') Exception in thread Thread-1:
> Traceback (most recent call last):
> File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
> self.run()
> File "/usr/lib/python2.7/threading.py", line 504, in run
> self.__target(*self.__args, **self.__kwargs)
> File "/home/sepp/.vim/plugin/nm_vim.py", line 195, in _refresh_thread
> authors, subj, tags)).encode('utf-8')
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)
> ##########
>
Should be fixed now.
--
Anton Khirnov
next prev parent reply other threads:[~2012-08-10 8:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-05 13:52 Vim plugins Sepp Tannhuber
2012-08-06 16:17 ` Anton Khirnov
2012-08-06 22:29 ` Sepp Tannhuber
2012-08-07 4:42 ` Anton Khirnov
2012-08-07 8:35 ` Sepp Tannhuber
2012-08-07 9:39 ` Anton Khirnov
2012-08-09 8:49 ` Sepp Tannhuber
2012-08-10 8:13 ` Anton Khirnov [this message]
2012-08-16 17:20 ` Sepp Tannhuber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120810081355.5861.36559@daenerys.khirnov.net \
--to=anton@khirnov.net \
--cc=notmuch@notmuchmail.org \
--cc=sepp.tannhuber@yahoo.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).