[TxMt] VIM features I miss

Dan Weeks textmate at danimal.org
Thu Mar 8 23:56:48 UTC 2007


On 2007-03-08 18:M, Charilaos Skiadas threw down some bits like this:
> So maybe I am missing something, but what do you mean by read-only?  
> What is it that determines if the file is read-only or not? You  
> either have write-access to the file or not, and if you do not then  
> you wouldn't be able to save it anyway, while if you do then the file  
> is not read-only. And how would TM determine if the file is read-only  
> or not? I suppose it could try to write to the file, but wouldn't  
> that alter the modification date on every file where this is  
> successful, which is certainly not desirable? Or is there a tool to  
> test if a particular file is write-accessible to the current user?  
> And what if you want to edit some files that you only have access to  
> in administrator mode?
> 
> Sorry if this is a stupid question, I guess I just don't get it.

if a file is mode 444 then you can read it but TM will prompt you to
override when you try to save.  An example of another editor's
behaviour is Emacs.  If the mode is not writable then you can't modify
the buffer.  This would be nice to have in TM, but barring that maybe
a window title notice.  

I guess the way you'd think about it is something like this in
psuedo-python:

if not os.access(file, os.W_OK):
   windowBufferModifiable(False)
else:
   windowBufferModifiable(True)

Then again I just need to be smarter about doing p4 edit first :)


Dan



More information about the textmate mailing list