[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: why read only buffer?
From: |
PJ Weisberg |
Subject: |
Re: why read only buffer? |
Date: |
Fri, 6 Jul 2012 13:58:49 -0700 |
On Fri, Jul 6, 2012 at 12:44 PM, Alp Aker <alptekin.aker@gmail.com> wrote:
> On Fri, Jul 6, 2012 at 3:04 PM, notbob <notbob@nothome.com> wrote:
>> As you can see, it's a backup file. So? I can edit the regular file,
>> but not the backup (~) file. Identical permissions. WTF!?
>
> Use the command 'toggle-read-only' (default binding C-x C-q) if you
> want to edit a backup file.
That's deliberately there to stop you from accidentally modifying a
backup file when you meant to be working with the regular file. If
you searched through the source you'd find this in files.el:
-----
;; Make people do a little extra work (C-x C-q)
;; before altering a backup file.
(when (backup-file-name-p buffer-file-name)
(setq buffer-read-only t))
-----
-PJ
Gehm's Corollary to Clark's Law: Any technology distinguishable from
magic is insufficiently advanced.