On Thu, 2005-03-31 at 08:34 -0500, Stefan Monnier wrote: > Could you remind me why file-writable-p can't be used?
The conditions "file is writable by the calling user" and "file is locked by the calling user" are not equivalent. They can differ if somebody modifies file permissions deliberately (I've seen this happen at most sites where RCS is used). They also differ if RCS is used with non-strict locking. VC has lots of code to detect mismatches between the two conditions, because they do occur all the time in real world situations. There is also a special user option, vc-mistrust-permissions, which does precisely what the name suggests. So, in short, it is not possible to use file-writable-p. There needs to be a way, as Kai described, to compare the name of the calling user and the name of the locking user as per the RCS master file. I think the suggestion no. 2, file-calling-user, is best. Conceptually, it is something like "user-login-name relative to a given file". For files on the local machine, it is the name of the user running Emacs. For files on a remote machine, it is the name of the user under which the files are accessed (the login account at the remote machine). Perhaps it would be worthwhile to add an optional FILE argument to user-login-name, but it already has an optional argument, UID, so perhaps a new function, file-calling-user, as Kai suggests, is best. _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel