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