Hi folks,

I'm new to this list. Please let me know if I'm missing anything or
should be posting on another list.

I'm investigating this bug reported on Ubuntu's Launchpad:
        https://bugs.launchpad.net/ubuntu/+source/vim/+bug/11899
The quick summary is that Mutt asked Vim to edit a file under /tmp, and
the machine died. On rebooting, /tmp was cleaned and there was no trace
of the file or it's swapfile.

While Mutt could have used another, less volatile, location, I don't
think it's unreasonable for it to use /tmp for a temporary file. Since
several systems use RAM-based filesystems for certain areas of disk,
perhaps Vim can help by avoiding certain directories for swapfiles.

One idea would be to dynamically adjust the "directory" option, based on
where the file is. Something roughly like this would work:
        autocmd BufNewFile,BufRead if (split(bufname(),"\/")[0]=="tmp") 
setlocal directory-=.
and simply needs "directory" to be a global/local variable (it's global
only at the moment).

An alternative would be to create a new variable for "unsafe" paths on
disk. This might have more uses, and could easily be set centrally by a
specific distribution if they desire. On the other hand, it would be
more disruptive to Vim's code itself.

Thoughts? Any better/cleaner ideas?

Thanks!

Andrew

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui