bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ensure that generated files are read-only


From: Jim Meyering
Subject: Re: ensure that generated files are read-only
Date: Fri, 08 Sep 2006 08:52:27 +0200

Paul Eggert <address@hidden> wrote:
> Jim Meyering <address@hidden> writes:
>> If it's really a major annoyance, you should switch to
>> an editor that lets you circumvent such things more easily.
>> In Emacs, C-xC-q is the typical binding to toggle read-only.
>> For Vi, to save a file owned by you, in spite of its read-only
>> setting, just use :w!
>
> I suspect he's objecting to even these minor hassles.
>
> Also, :w! does not overwrite readonly files in Bill Joy's original
> "vi", which I still commonly use (I just tested this on Solaris 10).
> (I still prefer the original "vi" to VIM since my fingers are used to
> its behavior.  :-)
>
> And perhaps other people use other editors; we can't really expect
> everyone to switch to Emacs or VIM.

Hi Paul,

It sounds like you think the files would remain with read-only
permissions.

I understood (and implemented, for coreutils) Bruce's proposal
to leave the files with their original -- usually owner-writable --
permissions, yet to add these hints/warning on the first lines:

  -*- buffer-read-only: t -*- vi: set ro:
  DO NOT EDIT! GENERATED AUTOMATICALLY!

Then, people with emacs or recent Vi/Vim will be warned before
making changes to the file.  But as I said above, it's trivial
to override these settings.  With recent emacs, you'll be asked
whether to apply the hint (yes, no, or always).  With legacy Vi,
the hint has no effect at all.

Jim




reply via email to

[Prev in Thread] Current Thread [Next in Thread]