vim: skip trailing slash for g:notmuch_compose_temp_file_dir
authorUwe Kleine-König <ukleinek@strlen.de>
Sun, 10 Jul 2011 19:42:41 +0000 (21:42 +0200)
committerFelipe Contreras <felipe.contreras@gmail.com>
Sat, 16 Jul 2011 18:49:12 +0000 (21:49 +0300)
With the trailing slash I get

Error detected while processing function <SNR>10_NM_new_mail..<SNR>10_NM_cmd_compose..<SNR>10_NM_newComposeBuffer..<SNR>10_NM_newFileBuffer:
line    3:
E739: Cannot create directory: /home/ukleinek/.notmuch/compose/

when hitting 'm' to compose a new mail. strace shows:

stat("/home/ukleinek/.notmuch/compose/", 0x7fffee314a10) = -1 ENOENT (No such file or directory)
stat("/home/ukleinek/.notmuch/compose/", 0x7fffee314e30) = -1 ENOENT (No such file or directory)
stat("/home/ukleinek/.notmuch/compose", 0x7fffee315270) = -1 ENOENT (No such file or directory)
stat("/home/ukleinek/.notmuch", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
mkdir("/home/ukleinek/.notmuch/compose", 0755) = 0
mkdir("/home/ukleinek/.notmuch/compose/", 0755) = -1 EEXIST (File exists)

so it seems vim's mkdir() isn't able to handle a trailing slash.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
vim/plugin/notmuch.vim

index 768a011cf7bc959b9057e2a34b0b31d578e88c64..181e626e628d2a15b4bfb1756da30bc2deed79c9 100644 (file)
@@ -58,7 +58,7 @@ let s:notmuch_defaults = {
         \
         \ 'g:notmuch_compose_insert_mode_start':     1                            ,
         \ 'g:notmuch_compose_header_help':           1                            ,
-        \ 'g:notmuch_compose_temp_file_dir':         '~/.notmuch/compose/'        ,
+        \ 'g:notmuch_compose_temp_file_dir':         '~/.notmuch/compose        ,
         \ }
 
 " defaults for g:notmuch_initial_search_words