From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.bugs Subject: bug#22819: 25.0.91; Don't try to indent region if the buffer is read-only Date: Mon, 07 Aug 2017 17:45:36 +0000 Message-ID: References: <87vam26amc.fsf@users.sourceforge.net> <83lgmywlo4.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c1a1e94afa88a05562d6a80" X-Trace: blaine.gmane.org 1502127989 32111 195.159.176.226 (7 Aug 2017 17:46:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 7 Aug 2017 17:46:29 +0000 (UTC) Cc: 22819@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 07 19:46:15 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1dem6W-0007g1-IZ for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Aug 2017 19:46:12 +0200 Original-Received: from localhost ([::1]:38698 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dem6c-0005I9-Rn for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Aug 2017 13:46:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53653) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dem6R-0005HW-QM for bug-gnu-emacs@gnu.org; Mon, 07 Aug 2017 13:46:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dem6M-00077N-PX for bug-gnu-emacs@gnu.org; Mon, 07 Aug 2017 13:46:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41986) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dem6M-000770-LZ for bug-gnu-emacs@gnu.org; Mon, 07 Aug 2017 13:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dem6M-00025a-AX for bug-gnu-emacs@gnu.org; Mon, 07 Aug 2017 13:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Kaushal Modi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 07 Aug 2017 17:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22819 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 22819-submit@debbugs.gnu.org id=B22819.15021279558009 (code B ref 22819); Mon, 07 Aug 2017 17:46:02 +0000 Original-Received: (at 22819) by debbugs.gnu.org; 7 Aug 2017 17:45:55 +0000 Original-Received: from localhost ([127.0.0.1]:50667 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dem6F-000257-72 for submit@debbugs.gnu.org; Mon, 07 Aug 2017 13:45:55 -0400 Original-Received: from mail-lf0-f52.google.com ([209.85.215.52]:36308) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dem6D-00024r-01 for 22819@debbugs.gnu.org; Mon, 07 Aug 2017 13:45:53 -0400 Original-Received: by mail-lf0-f52.google.com with SMTP id o85so4940781lff.3 for <22819@debbugs.gnu.org>; Mon, 07 Aug 2017 10:45:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IAff/opN885PbVTpq1wetsrPN8o/yvcLQiXiTZhpRSg=; b=MzuS7ZhPxFiKjdr0ub1qwxtTpiTDz0uK2UiGP5h062US6ZTmHVxUBxwRZIWqh86MkR Bi2nJoAk/sCOgxaI+7hyfkxaJVz1Z0tsCZRp+PePg/CP1+pobtGAwQ44bqFe525DZD82 koToNZCMJIkm0DCjBZdiSOAG6peejy/XzAtNpBqZb9SjdKp5qwG4BqJKcamWz7sK2iCc disQEAu8ibMv7Ve2+hu+1wFnD36I3HhSLg0+Pgcbm+fIbSYxVxExK/hSbJiFAtA9Mxt/ AvHLPyaMhq803P7xEZWc3TsKkagIW2BISb5DrLho+buYjFeKVQ9iMyxjW1iR6Cb1WD3O kZwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IAff/opN885PbVTpq1wetsrPN8o/yvcLQiXiTZhpRSg=; b=cLr+H5C/YQfqwmbdkL+VB61WHwjdMrdK4ESedJyIO4qCrw/5y1ol+610BOZ4DhlfXb RxiFLtQoXbDQHez2V8txXHh942hmYA75urB4cujbL7CsdOkaFqzJI8Xp70cHNPdLKgXM BKABQfyVKNJPfCfKtER9klzHlPaaFcEMnJVZeUAWmTmJFYdunzYTO9YoCPs8K6itmG6E VT+xus15vjZK310NJdvIV3WEXwju/xv9AzZhzZidbjKL4DWJ9/KScRwCwNUkuMCl4gBs 7VwAV6489rcWxIgENwy8rloDGY0m8Q3eBDRxnjriZRWnscA8LjUHZtH8yJyQAtHlIaSV TyyA== X-Gm-Message-State: AHYfb5htxexkJUceXZu4ImVXXpJi5Aw/9HuwiJMU+N1zAPWBWad14Giw maCVDU5FS0peoGuEaas0BMstoBAhtw== X-Received: by 10.25.72.21 with SMTP id v21mr362221lfa.201.1502127946964; Mon, 07 Aug 2017 10:45:46 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:135542 Archived-At: --94eb2c1a1e94afa88a05562d6a80 Content-Type: text/plain; charset="UTF-8" On Sat, Aug 5, 2017 at 7:50 AM Kaushal Modi wrote: > > Thanks Noam for reviewing this. I am away from PC for a few days. I'll > review your patch next week on Tuesday. > Hi Noam, I was able to try the patch sooner. I use verilog-mode and tried out your patch on a huge SystemVerilog file, which usually takes a tangible amount of time (10's of seconds) to indent the whole file -- C-x h C-M-\ When using (barf-if-buffer-read-only): - The failure due to a buffer being read-only is instantaneous. - As soon as I do C-x h C-M-\, I get: == *Messages* == Buffer is read-only: # ===== When using (interactive "*r\nP"): - The failure happens soon, but not instantaneously.. I start seeing the progress percentage of the indentation happening, and then the read-only error shows. - After I do C-x h C-M-\, I get the below after a second or two: == *Messages* == indent-region Indenting region...45% verilog-do-indent: Buffer is read-only: # ===== So looks like the read-only check based on interactive form is kicked in some time after the user calls indent-region.. I tried looking at verilog-do-indent code in verilog-mode.el[1], but I couldn't understand why interactive * based error is delayed. [1]: http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/progmodes/verilog-mode.el -- Kaushal Modi --94eb2c1a1e94afa88a05562d6a80 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sat, Aug 5,= 2017 at 7:50 AM Kaushal Modi <kaushal.modi@gmail.com> wrote:

Thanks= Noam for reviewing this. I am away from PC for a few days. I'll review= your patch next week on Tuesday.

Hi = Noam,

I was able to try the patch sooner.

I use verilog-mode and tried out your patch on a huge Syst= emVerilog file, which usually takes a tangible amount of time (10's of = seconds) to indent the whole file -- C-x h C-M-\

W= hen using=C2=A0(barf-if-buffer-read-only):
- The failure due to a = buffer being read-only is instantaneous.
- As soon as I do C-x h C-M-\, I get:

=3D=3D *Messages* =3D=3D
Buffer is read-only: #<buffer file.sv>
=3D=3D= =3D=3D=3D

=
When using (interactive "*r\nP"):
- The failure happ= ens soon, but not instantaneously.. I start seeing the progress percentage = of the indentation happening, and then the read-only error shows.
- After I do C-x h C-M-\, I get the below after a second or two:
=3D=3D = *Messages* =3D=3D
indent-region
Indenting regio= n...45%
verilog-do-indent: Buffer is read-only: #<buffer file.sv>
= =3D=3D=3D=3D=3D

So looks like the read-only check based on interacti= ve form is kicked in some time after the user calls indent-region.. I tried= looking at verilog-do-indent code in verilog-mode.el[1], but I couldn'= t understand why interactive * based error is delayed.

=
--=

Kaushal Modi

--94eb2c1a1e94afa88a05562d6a80--