GNU bug report logs -
#22819
25.0.91; Don't try to indent region if the buffer is read-only
Previous Next
Reported by: Kaushal Modi <kaushal.modi <at> gmail.com>
Date: Fri, 26 Feb 2016 13:56:02 UTC
Severity: wishlist
Tags: patch, wontfix
Found in version 25.0.91
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
--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
[Message part 2 (text/html, inline)]
This bug report was last modified 5 years and 331 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.