- Subject: Re: Bug: Jed flags readonly file as readonly while opening it as root
- From: "John E. Davis" <davis@xxxxxxxxxxxxx>
- Date: Tue, 24 Nov 2009 00:46:11 -0500
Jörg Sommer <joerg@xxxxxxxxxxxx> wrote:
> opening a file that misses the flag for write permission does not mean we
> can't write to it. Root can write to everything, execpt some
> exceptions. :) So I think jed should better use the access function to
> determine if it should flag a buffer readonly or not. Maybe some
> special file tweakings also allow write access, i.e. ACLs.
I see this as more of a feature than a bug in the sense that having
the read-only flag set is a reminder that the file has been marked as
read-only. If root wants to write to this file, then the buffer's
flag can easily be toggled (emacs bindings: Ctrl-X t). Nevertheless,
if you want to disable this feature, then you might try putting
something along the lines of the following in your .jedrc file:
private define check_access_perms ()
{
variable file = buffer_filename ();
if (file == "")
return;
if (0 == access (file, W_OK))
set_readonly (0);
}
add_to_hook ("_jed_find_file_after_hooks", &check_access_perms);
Thanks,
--John
--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.
[2009 date index]
[2009 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]