all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: 22819@debbugs.gnu.org
Subject: bug#22819: 25.0.91; Don't try to indent region if the buffer is read-only
Date: Fri, 26 Feb 2016 08:54:20 -0500	[thread overview]
Message-ID: <CAFyQvY2fpSRWG=fBzt=A7ufUZx2vGuD5ghgVKV1J7yNCjr-1GQ@mail.gmail.com> (raw)

[-- 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 --]

             reply	other threads:[~2016-02-26 13:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-26 13:54 Kaushal Modi [this message]
2017-08-05  1:56 ` bug#22819: 25.0.91; Don't try to indent region if the buffer is read-only 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFyQvY2fpSRWG=fBzt=A7ufUZx2vGuD5ghgVKV1J7yNCjr-1GQ@mail.gmail.com' \
    --to=kaushal.modi@gmail.com \
    --cc=22819@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.