Subject: bug#6922: 23.1; Setting read-only property in an overlay has no effect

From: "MT" <[email-masked]>
Date: Thu, 26 Aug 2010 16:46:56 +0200

If I create an overlay in a buffer and set the 'read-only' property to
t, it seems to make no difference, and I can still make changes to the
text in the region where the overlay is active. Setting other overlay
properties does have an effect. Setting the read-only property as a text
property however works as expected.

To demonstrate:
1. Type some text in an empty buffer.
2. (setq overlay (make-overlay 1 10)) ; Creates an overlay in this
buffer between positions 1-10 named 'overlay'
3. (overlay-put overlay 'read-only t) ; Applies the read-only property
to this overlay.
4. Type some characters at the beginning of the buffer. Emacs doesn't
complain that the text is read-only, and text is edited as normal.

I do this instead:
   (put-text-property 1 10 'read-only t) ; Apply the read-only property
   as a text property rather than an overlay
Now if I try typing text in the same region as before, Emacs prevents me
from doing so and says 'Text is read-only'.

In GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0)
 of 2010-03-29 on rothera, modified by Debian
Windowing system distributor `The X.Org Foundation', version
11.0.10706000
configured using `configure  '--build=i486-linux-gnu'
'--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib'
'--libexecdir=/usr/lib' '--localstatedir=/var/lib'
'--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes'
'--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim'
'--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars'
'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu'
'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS=''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: C
  value of $LC_TIME: en_DK.UTF-8
  value of $LANG: en_IN.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Fundamental

Minor modes in effect:
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
M-x r e p o r t - e m a c s - b u g <return>

Recent messages:
Setting up ede...
Loading `eieio': old-style backquotes detected!
Setting up ede...done
Setting up eieio...done
Setting up semantic...done
Setting up speedbar...done
Setting up cedet-contrib...done
Loading /etc/emacs/site-start.d/55ecb.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.
/usr/bin/mail is not an executable.  Setting mail-interactive to t.

-- 
http://www.fastmail.fm - Or how I learned to stop worrying and
                          love email again