[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC] Do indent-region only on editable buffers
From: |
Stefan Monnier |
Subject: |
Re: [RFC] Do indent-region only on editable buffers |
Date: |
Mon, 07 Aug 2017 15:55:17 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
> The proposal is to call (barf-if-buffer-read-only) before attempting to do
> the indent.
No objection here.
> change is required? Here's what's will happen: 1. User: Try indentation
> (C-x h M-x indent-region) 2. User: Could take several seconds or few
> minutes (depending on major mode and file size) 3. Emacs: "Bummer, couldn't
> save all that indentation because the buffer is read-only". 4. User: Make
Indentation of a region isn't done by computing the complete result and
then "saving" it into the buffer. So the error will be signaled as soon
as the indent-region finds a line whose indentation should be changed.
Usually that's almost instantaneous, but indeed in some cases it can
take a while (e.g. in large regions that are already indented except for
the last few lines).
Stefan