unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#22819: 25.0.91; Don't try to indent region if the buffer is read-only
@ 2016-02-26 13:54 Kaushal Modi
  2017-08-05  1:56 ` npostavs
  0 siblings, 1 reply; 22+ messages in thread
From: Kaushal Modi @ 2016-02-26 13:54 UTC (permalink / raw)
  To: 22819

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

--text follows this line--

The current behavior of indent-region function is that it will first indent
the buffer and then throw an error at the end that it couldn't apply the
indentation. Instead the below patch checks if the buffer if read-only
first before trying to indent.


diff --git a/lisp/indent.el b/lisp/indent.el
index 0bbb520..d525511 100644
--- a/lisp/indent.el
+++ b/lisp/indent.el
@@ -509,6 +509,7 @@ indent-region
 If the third argument COLUMN is an integer, it specifies the
 column to indent to; if it is nil, use one of the three methods above."
   (interactive "r\nP")
+  (barf-if-buffer-read-only)
   (cond
    ;; If a numeric prefix is given, indent to that column.
    (column



In GNU Emacs 25.0.91.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.23)
 of 2016-02-25 built on ...
Repository revision: d2dd614716e34edb5891e58c029741cd6b32217d
Windowing system distributor 'The X.Org Foundation', version 11.0.60900000
System Description: Red Hat Enterprise Linux Workstation release 6.6
(Santiago)

Configured using:
 'configure --prefix=/home/kmodi/usr_local/apps/6/emacs/emacs-25
 'CPPFLAGS=-fgnu89-inline -I/home/kmodi/usr_local/6/include
 -I/usr/include/freetype2 -I/usr/include' 'CFLAGS=-ggdb3 -O0'
 'CXXFLAGS=-ggdb3 -O0' 'LDFLAGS=-L/home/kmodi/usr_local/6/lib
 -L/home/kmodi/usr_local/6/lib64 -ggdb3'
 PKG_CONFIG_PATH=/home/kmodi/usr_local/6/lib/pkgconfig:/home/kmodi/usr_local/6/lib64/pkgconfig:/cad/adi/apps/gnu/linux/x86_64/6/lib/pkgconfig:/cad/adi/apps/gnu/linux/x86_64/6/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/lib64/pkgconfig:/usr/share/pkgconfig:/lib/pkgconfig:/lib64/pkgconfig'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK2 X11

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

^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2019-06-25 14:35 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-26 13:54 bug#22819: 25.0.91; Don't try to indent region if the buffer is read-only Kaushal Modi
2017-08-05  1:56 ` npostavs
2017-08-05  6:52   ` Eli Zaretskii
2017-08-05 11:50     ` Kaushal Modi
2017-08-05 12:10       ` Eli Zaretskii
2017-08-05 12:29         ` Kaushal Modi
2017-08-05 12:37           ` Eli Zaretskii
2017-08-05 12:47         ` npostavs
2017-08-05 13:13           ` Eli Zaretskii
2017-08-07 17:45       ` Kaushal Modi
2017-08-07 17:53         ` Noam Postavsky
2017-08-07 18:02           ` Kaushal Modi
2017-08-07 18:11             ` Noam Postavsky
2017-08-08 13:06               ` Kaushal Modi
2017-08-08 13:15                 ` npostavs
2017-08-08 19:05                 ` Eli Zaretskii
2017-08-08 19:19                   ` Kaushal Modi
2017-08-08 21:31                     ` John Wiegley
2017-08-09 11:03                       ` Kaushal Modi
2017-08-09 21:14                         ` John Wiegley
2019-06-25 14:33                   ` Lars Ingebrigtsen
2019-06-25 14:35                     ` Kaushal Modi

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