Vim plugins

Sepp Tannhuber sepp.tannhuber at yahoo.de
Thu Aug 9 01:49:19 PDT 2012


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.

Is it possible suppress the message returned by
    python nm_vim.get_current_buffer()?
 
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)
##########

Thanks for your great work and support
Joseph


More information about the notmuch mailing list