unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>, emacs-devel@gnu.org
Subject: Re: [RFC] Do indent-region only on editable buffers
Date: Mon, 07 Aug 2017 20:07:42 +0000	[thread overview]
Message-ID: <CAFyQvY3bDZexQMhs0k83HUQ8o4nVYcaHWZymU599SvOgKGkU6A@mail.gmail.com> (raw)
In-Reply-To: <jwvzibb5f5c.fsf-monnier+gmane.emacs.devel@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1067 bytes --]

On Mon, Aug 7, 2017 at 3:55 PM Stefan Monnier <monnier@iro.umontreal.ca>
wrote:

> > The proposal is to call (barf-if-buffer-read-only) before attempting to
> do
> > the indent.
>
> No objection here.
>

Thanks.


> > 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).
>

Thanks for explaining the behavior. That explains why the read-only buffer
error is not thrown if the buffer is already indented.
-- 

Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 1690 bytes --]

  reply	other threads:[~2017-08-07 20:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-07 17:36 [RFC] Do indent-region only on editable buffers Kaushal Modi
2017-08-07 17:46 ` Drew Adams
2017-08-07 17:56   ` Kaushal Modi
2017-08-07 18:13   ` Noam Postavsky
2017-08-07 19:55 ` Stefan Monnier
2017-08-07 20:07   ` Kaushal Modi [this message]
2017-08-07 23:03   ` John Wiegley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFyQvY3bDZexQMhs0k83HUQ8o4nVYcaHWZymU599SvOgKGkU6A@mail.gmail.com \
    --to=kaushal.modi@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).