Subject: bug#10006: closed (Re: bug#10006: 24.0.91; set-text-properties fails with "Text is read-only", but didn't in Emacs 23)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 10 Nov 2011 02:20:02 +0000

Your bug report

#10006: 24.0.91; set-text-properties fails with "Text is read-only", but didn't in Emacs 23

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
10006: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10006
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#10006: 24.0.91; set-text-properties fails with "Text is read-only", but didn't in Emacs 23
From: Glenn Morris <[email-masked]>
To: [email-masked]
Date: Wed, 09 Nov 2011 21:18:57 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

Version: 24.0.92

Glenn Morris wrote:

> I do think it ought to be documented somewhere (if it is not already)
> that toggle-read-only is the wrong thing to use non-interactively.
>
> We've previously said that it should be added to
> byte-compile-interactive-only-functions,

Done.

Subject: 24.0.91; set-text-properties fails with "Text is read-only", but didn't in Emacs 23
From: Eric Hanchrow <[email-masked]>
To: [email-masked]
Date: Wed, 9 Nov 2011 15:19:20 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

This bug report will be sent to the Bug-GNU-Emacs mailing list
and the GNU bug tracker at debbugs.gnu.org.  Please check that
the From: line contains a valid email address.  After a delay of up
to one day, you should receive an acknowledgement at that address.

Please write in English if possible, as the Emacs maintainers
usually do not have translators for other languages.

Please describe exactly what actions triggered the bug, and
the precise symptoms of the bug.  If you can, give a recipe
starting from `emacs -Q':

Put the following into /tmp/fail.el:
===8<===8<===8<===8<===8<===8<===8<===8<===8<===8<===8<===8<===
(insert "frotz")
(occur "f")
(set-buffer (get-buffer "*Occur*"))
(fundamental-mode)
(toggle-read-only 0)
(set-text-properties (point-min) (point-max) nil)
===>8===>8===>8===>8===>8===>8===>8===>8===>8===>8===>8===>8===

Invoke emacs like this:

    $ emacs -Q --batch --load /tmp/fail.el  ; echo $?

You'll see

    Searched 1 buffer; 1 match
    Text is read-only
    255

However, if I use emacs23, I instead see

    Searched 1 buffer; 1 match for `f'
    0

I'm not sure which behavior is actually correct, but I wrote a little
function that depended on the old behavior, so from my point of view,
the error is a bug.

This is a recently-built emacs from the "master" branch:

    commit 4d6d2b81f839f79b96b1e586e4686e8009276b26
    Author: Eli Zaretskii <[email-masked]>
    Date:   Mon Nov 7 18:42:34 2011 +0200

        Allow to run temacs.exe on MS-Windows in GUI mode.

         src/w32.c (check_windows_init_file): Don't look for term/w32-win.el
         if Vpurify_flag is non-nil.  Fixes a crash when running w32 build
         of temacs in GUI mode.

In GNU Emacs 24.0.91.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.20.1)
 of 2011-11-07 on rampage.sea
Windowing system distributor `The X.Org Foundation', version 11.0.10402000
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: C
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Emacs-Lisp

Minor modes in effect:
  shell-dirtrack-mode: t
  eldoc-mode: t
  diff-auto-refine-mode: t
  global-auto-revert-mode: t
  recentf-mode: t
  ido-everywhere: t
  display-time-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-M-o <tab> <tab> <M-backspace> <M-backspace> <M-backspace>
b i n <tab> e m <tab> C-d M-SPC M-d M-d C-d <return>
e c h o SPC $ ? <return> M-p M-p C-a C-M-f C-M-f C-k
<return> C-x o M-< C-e M-b M-d . C-x C-s C-x o C-u
C-p C-u C-p C-u C-p <return> C-x o <backspace> C-x
C-s C-x o M-p <return> C-x 1 M-- C-l C-x b <return>
C-u C-n C-n C-x F <return> C-x n d C-x n w C-s s t
r i n g p C-x n d C-a C-s C-s C-s C-s C-x n w C-x b
<return> M-x t o g g l <tab> d e <tab> e <tab> <return>
C-e C-x C-e C-x b * O c c C-g M-< C-s o M-s o C-x o
M-: M-p <return> C-x C-q M-: M-p <return> C-x o C-x
o C-x C-k <return> C-x 0 M-x o c c u r <return> s d
l f k j s d f l k j <return> C-a C-M-o M-( i n s e
r t SPC " f r o t z " C-a C-n M-f C-f C-f d <backspace>
f C-x C-s C-x 2 C-x b s h e <return> M-p <return> e
c h o SPC $ ? <return> M-p M-p C-a C-M-f M-b M-d <M-backspace>
l o <tab> s r <tab> e m <tab> - <tab> m <tab> s r <tab>
e m <tab> C-e SPC ; SPC e c h o S-SPC $ ? <return>
C-x o C-a C-n C-n C-n ; C-x C-s C-x o M-p <return>
M-p C-a M-f M-d M-d M-d M-d M-d / b i n <return> C-x
o C-a C-k C-x C-o C-x C-s M-x r e p o e <backspace>
r t - e m <tab> <return>

Recent messages:
Wrote /tmp/fail.el
History item: 1 [2 times]
History item: 2
Making completion list...
Saving file /tmp/fail.el...
Wrote /tmp/fail.el
History item: 1 [2 times]
Saving file /tmp/fail.el...
Wrote /tmp/fail.el
Scanning for dabbrevs...99%

Load-path shadows:
~/.emacs.d/custom hides /usr/local/src/emacs-master/lisp/custom
/usr/local/src/magit/.dir-locals hides
/usr/local/src/emacs-master/lisp/gnus/.dir-locals

Features:
(shadow mail-extr message rfc822 mml mml-sec mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader emacsbug
cus-start cus-load cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles
cc-align cc-engine cc-vars cc-defs vc-svn sort column-marker wdired
find-dired browse-kill-ring face-remap debug edit-list compare-w
epa-file epa epg epg-config ispell info image-mode nxml-uchnm rng-xsd
xsd-regexp rng-cmpct rng-nxml rng-valid rng-loc rng-uri rng-parse
nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns nxml-mode
nxml-outln nxml-rap nxml-util nxml-glyph nxml-enc xmltok sgml-mode
sh-script executable chistory tabify disp-table jka-compr log-view
dired-aux apropos iso-transl pp descr-text help-mode view org-wl org-w3m
org-vm org-rmail org-mhe org-mew org-irc org-jsinfo org-infojs org-html
format-spec org-exp ob-exp org-exp-blocks org-agenda org-info org-gnus
org-docview org-bibtex bibtex org-bbdb org ob-emacs-lisp ob-tangle
ob-ref ob-lob ob-table org-footnote org-src ob-comint ob-keys ob ob-eval
org-pcomplete org-list org-faces org-compat org-entities org-macs
noutline outline cal-menu calendar cal-loaddefs vc-dir ewoc sql-indent
sql thingatpt smerge-mode conf-mode newcomment vc ediff-merg ediff-diff
ediff-wind ediff-help ediff-util ediff-mult ediff-init ediff
vc-dispatcher multi-isearch cperl-mode ffap dabbrev rect pcmpl-unix
shell pcomplete ibuf-ext woman man midnight uniquify warnings protbuf
eldoc marchex-erich etags magit-bisect magit-key-mode magit diff-mode
log-edit easy-mmode pcvs-util add-log vc-git derived autorevert
paste-to-dropbox advice help-fns advice-preload ansi-color cmuscheme
scheme path server starttls smtpmail auth-source eieio byte-opt bytecomp
byte-compile cconv macroexp assoc gnus-util password-cache sendmail
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils grep compile
comint ring cl find-func ibuf-macs ibuffer recentf tree-widget wid-edit
ido dired-x easymenu dired regexp-opt edmacro kmacro rx autoinsert time
time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd
tool-bar dnd fontset image fringe lisp-mode register page menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces
cus-face files text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget hashtable-print-readable backquote
make-network-process dbusbind dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)