bug-gnu-emacs
[Top][All Lists]
Advanced

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

Re: yes I'm root but want 444 files found readonly


From: Francesco Potorti`
Subject: Re: yes I'm root but want 444 files found readonly
Date: 02 Jul 2002 18:16:15 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.90

   See below for a sample implementation that finds such files in
   read-only mode.

This one does no prompting, and does the trick as well, if I forgot
nothing: 

(defun set-read-only-if-file-not-writable ()
  (when (zerop (logand (file-modes (buffer-file-name)) #o222))
    (setq buffer-read-only t)))
(add-hook 'find-file-hooks 'set-read-only-if-file-not-writable)



reply via email to

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