Subject: bug#14887: closed (Re: bug#14887: 24.2; enriched-mode, message "Text is read only" on buffer save)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 27 Jul 2013 00:33:02 +0000

Your bug report

#14887: 24.2; enriched-mode, message "Text is read only" on buffer save

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

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

Subject: Re: bug#14887: 24.2; enriched-mode, message "Text is read only" on buffer save
From: Glenn Morris <[email-masked]>
To: [email-masked]
Date: Fri, 26 Jul 2013 20:32:22 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Version: 24.4

Thanks for the report. This patch (against 24.3) fixes it.
(Because format.el is compiled into Emacs, you must rebuild Emacs after
applying this patch.)

*** lisp/format.el	2013-01-01 09:11:05 +0000
--- lisp/format.el	2013-07-27 00:29:42 +0000
***************
*** 225,234 ****
  		(setq selective-display sel-disp)
  		(set-buffer-multibyte multibyte)
  		(setq buffer-file-coding-system coding-system))
! 	      (copy-to-buffer copy-buf from to)
! 	      (set-buffer copy-buf)
! 	      (format-insert-annotations write-region-annotations-so-far from)
! 	      (format-encode-run-method to-fn (point-min) (point-max) orig-buf)
                (when (buffer-live-p copy-buf)
                  (with-current-buffer copy-buf
                    ;; Set write-region-post-annotation-function to
--- 225,236 ----
  		(setq selective-display sel-disp)
  		(set-buffer-multibyte multibyte)
  		(setq buffer-file-coding-system coding-system))
! 	      (let ((inhibit-read-only t)) ; bug#14887
! 		(copy-to-buffer copy-buf from to)
! 		(set-buffer copy-buf)
! 		(format-insert-annotations write-region-annotations-so-far from)
! 		(format-encode-run-method to-fn (point-min) (point-max)
! 					  orig-buf))
                (when (buffer-live-p copy-buf)
                  (with-current-buffer copy-buf
                    ;; Set write-region-post-annotation-function to

Subject: 24.2; enriched-mode, message "Text is read only" on buffer save
From: [email-masked]
To: [email-masked]
Date: Wed, 17 Jul 2013 01:14:41 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

================= how to replicate =================
- start up Emacs
- M-x enriched-mode
- write some text like "hello dear friends!" in buffer
- select the word "dear" with the mouse
- make "dear" read-only using Edit/Text properties/
  /Special prop./Read only
- C-x C-s to save file as test1.txt (save operation
  will be successful)
- write additional text " thanks!" after "friends!"
- C-x C-s to save again; this time file saving will
  not succeed, and you will see the message "Text file
  is read only"
====================================================

  May someone please confirm if he/she can replicate
this somewhat weird behaviour. I think it may be some
small error in enriched-mode, but I'm rather new to
Emacs and may have missed something. 

  My kindest regards,

       Andrea Rossetti
http://github.com/thesoftwarebin

In GNU Emacs 24.2.1 (i386-mingw-nt6.1.7600)
 of 2012-08-29 on MARVIN
Windowing system distributor `Microsoft Corp.', version 6.1.7600
Configured using:
 `configure --with-gcc (4.6) --cflags
 -ID:/devel/emacs/libs/libXpm-3.5.8/include
 -ID:/devel/emacs/libs/libXpm-3.5.8/src
 -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include
 -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include
 -ID:/devel/emacs/libs/giflib-4.1.4-1/include
 -ID:/devel/emacs/libs/jpeg-6b-4/include
 -ID:/devel/emacs/libs/tiff-3.8.2-1/include
 -ID:/devel/emacs/libs/gnutls-3.0.9/include'

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: nil
  value of $LC_TIME: nil
  value of $LANG: ITA
  value of $XMODIFIERS: nil
  locale-coding-system: cp1252
  default enable-multibyte-characters: t

Major mode: Text

Minor modes in effect:
  enriched-mode: t
  show-paren-mode: t
  server-mode: t
  recentf-mode: t
  cua-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  use-hard-newlines: t
  menu-bar-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
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<help-echo> <help-echo> M-x e n r i c h e d - m o d 
e <return> y <help-echo> <help-echo> <help-echo> <down-mouse-1> 
<mouse-movement> <mouse-movement> <drag-mouse-1> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<menu-bar> <edit> <props> <sp> r C-x C-s <C-S-left> 
<C-S-left> <C-S-left> <C-S-left> <C-S-left> <C-S-right> 
<S-right> D e s k t o p / p r o v a . <backspace> 1 
. t x t <return> <C-S-kp-end> <up> <down> e x t r a 
SPC t e x t C-x C-s M-x r e p o <tab> r t - e m <tab> 
<return>

Recent messages:
Loading c:/Users/andrea/AppData/Roaming/.recentf...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Make newlines between paragraphs hard? (y or n)  y
Enriched: encoding document...
These text properties could not be saved:
    (fontified)
Wrote c:/Users/andrea/Desktop/prova1.txt
Saving file c:/Users/andrea/Desktop/prova1.txt...
copy-to-buffer: Text is read-only
Making completion list...

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message format-spec rfc822 mml mml-sec
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader sendmail regexp-opt rfc2047 rfc2045 ietf-drums help-mode view
enriched csv-mode-autoloads graphviz-dot-mode-autoloads muse-autoloads
info paredit-autoloads slime-repl-autoloads slime-autoloads package
tabulated-list edmacro kmacro paren server recentf tree-widget easymenu
gnus gnus-ems nnheader gnus-util mail-utils mm-util mail-prsvr wid-edit
cua-base cus-start cus-load time-date tooltip ediff-hook vc-hooks
lisp-float-type mwheel dos-w32 disp-table ls-lisp w32-win w32-vars
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 multi-tty emacs)