From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.devel Subject: Re: [RFC] Do indent-region only on editable buffers Date: Mon, 7 Aug 2017 14:13:28 -0400 Message-ID: References: <798abe90-2eb4-46e3-a897-1dc75c959880@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1502129667 8440 195.159.176.226 (7 Aug 2017 18:14:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 7 Aug 2017 18:14:27 +0000 (UTC) Cc: Emacs developers , Kaushal Modi To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 07 20:14:13 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 1demXW-0001FP-Q9 for ged-emacs-devel@m.gmane.org; Mon, 07 Aug 2017 20:14:06 +0200 Original-Received: from localhost ([::1]:38796 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1demXd-0005RI-2D for ged-emacs-devel@m.gmane.org; Mon, 07 Aug 2017 14:14:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38171) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1demX1-0005Qi-B0 for emacs-devel@gnu.org; Mon, 07 Aug 2017 14:13:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1demWw-0006Ve-Eu for emacs-devel@gnu.org; Mon, 07 Aug 2017 14:13:35 -0400 Original-Received: from mail-oi0-x230.google.com ([2607:f8b0:4003:c06::230]:33031) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1demWw-0006VB-9l for emacs-devel@gnu.org; Mon, 07 Aug 2017 14:13:30 -0400 Original-Received: by mail-oi0-x230.google.com with SMTP id d71so11699335oih.0 for ; Mon, 07 Aug 2017 11:13:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=39HzH0TchRkJ5FqGg3HnefWiBdhl9AbmQ4845qKUjmQ=; b=SCXK1nbC+bZAeQf2oyrzCcQksttXBYJrGInDjSD7SXWmrjKoHigQ3dLAPb8m4r8ISV 4MBGbWw3ksb4ioLDra4eUl7OXIkKLW0T8ZHpPYL8jmKJb8huvJEJzcbK5elr7y4oiR/G 3uCpd1WchinnUG4TIEppY+ClkBlNIEs2m2u0grLwVUvEyUs8hp3x+u1icBqe5IbbZZR6 T+HWWAPKL6CBbAVauzoIAGl1j9FJFgdEDyM5jmTNVfEDguX8lJqj1N6hVTyx23V9wGAh wipmRC6GIYb1LRsbsF2dYaYllBVD9GJQZtq7+Ckwkm528NFg7WjPgeFSp6rujDHXy3Vw xzQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=39HzH0TchRkJ5FqGg3HnefWiBdhl9AbmQ4845qKUjmQ=; b=XgQhSoWAu5hCnAeb7fW7aUGDuroivvuena/w/SS2I5U0XxYTxTIJEF2tHZEwph3vPk Qjjwjd3L8my2J7ONecU/9IMjhdAb5SmiM85Dwpnbgz2ZkuB1pJnlRWc+aLeVVcvC+csU Dy6/jRBfbv/hlSAZwY13RWoRId8fVgKyo4KNAd03KrldEeWBVVFaH/YoMZx6xhenr2it OERTCfnfNRZzvwikQadb5D1qvIGYFbgbGq9OnO9W8ImKjtEasf3b02osDJPei5J/Ty51 bW78QG+N2wmN5YkGUUWmO4BwTyRC0jbED6a8DWKWObtQOu1WHskNbP/I9q3qiLGqOndG NiRQ== X-Gm-Message-State: AHYfb5hOTb6Ub+SJIN0A1qd+QkxafYZxXpEVGzyxyU5EfK/rQyavaI7N 3wiwv/vKq6mcEZS5qs3hwz/ZkjoF4A== X-Received: by 10.202.208.79 with SMTP id h76mr1096883oig.65.1502129609618; Mon, 07 Aug 2017 11:13:29 -0700 (PDT) Original-Received: by 10.74.18.129 with HTTP; Mon, 7 Aug 2017 11:13:28 -0700 (PDT) In-Reply-To: <798abe90-2eb4-46e3-a897-1dc75c959880@default> X-Google-Sender-Auth: i8HHkE--8ZsM_AnQDV_3gmFCheE X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::230 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:217363 Archived-At: On Mon, Aug 7, 2017 at 1:46 PM, Drew Adams wrote: >> - Are there any objections to doing the buffer read-only check before >> doing the indent? > > Dunno what the right approach/solution is in this particular case. > > But note that we don't do what you suggest in general - we don't do it > for most other editing operations: insert or delete a character, yank > a string, kill the region,... Instead, we let an error be raised, > telling the user that the buffer is read-only. The other commands you list finish pretty much instantaneously, so the difference is somewhat academic there. Although yank has (interactive "*P"), the star means the read-only check is at the beginning. So you can't successfully yank the empty string into a read-only buffer.