From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [RFC] Do indent-region only on editable buffers Date: Mon, 07 Aug 2017 15:55:17 -0400 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1502135793 3104 195.159.176.226 (7 Aug 2017 19:56:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 7 Aug 2017 19:56:33 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 07 21:56:19 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1deo8Q-00006D-L4 for ged-emacs-devel@m.gmane.org; Mon, 07 Aug 2017 21:56:18 +0200 Original-Received: from localhost ([::1]:39218 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1deo8W-0006lR-RH for ged-emacs-devel@m.gmane.org; Mon, 07 Aug 2017 15:56:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1deo7q-0006kT-Hk for emacs-devel@gnu.org; Mon, 07 Aug 2017 15:55:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1deo7l-0007o4-Ft for emacs-devel@gnu.org; Mon, 07 Aug 2017 15:55:42 -0400 Original-Received: from [195.159.176.226] (port=44414 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1deo7k-0007nH-Vl for emacs-devel@gnu.org; Mon, 07 Aug 2017 15:55:37 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1deo7Y-00069k-85 for emacs-devel@gnu.org; Mon, 07 Aug 2017 21:55:24 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 19 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:VK6lUGTiTHwDu2Rk5n2gwQHG+E4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:217365 Archived-At: > 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