From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.org!not-for-mail
From: Guido Van Hoecke <guivho@gmail.com>
Newsgroups: gmane.emacs.help
Subject: Re: Eshell - `Text is read-only`
Date: Mon, 30 Dec 2013 08:50:18 +0100
Message-ID: <m2iou6n5fp.fsf@gmail.com>
References: <d76e2299-abc0-4404-b8ba-797fb3894dfc@googlegroups.com>
	<m2mwjjmj3h.fsf@gmail.com>
	<1c364789-c247-433d-a306-35a7da0f4da6@default>
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: ger.gmane.org 1388389844 18190 80.91.229.3 (30 Dec 2013 07:50:44 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Mon, 30 Dec 2013 07:50:44 +0000 (UTC)
Cc: deech <aditya.siram@gmail.com>, help-gnu-emacs@gnu.org
To: Drew Adams <drew.adams@oracle.com>
Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Dec 30 08:50:50 2013
Return-path: <help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org>
Envelope-to: geh-help-gnu-emacs@m.gmane.org
Original-Received: from lists.gnu.org ([208.118.235.17])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org>)
	id 1VxXcf-0007d2-Hq
	for geh-help-gnu-emacs@m.gmane.org; Mon, 30 Dec 2013 08:50:49 +0100
Original-Received: from localhost ([::1]:57443 helo=lists.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org>)
	id 1VxXcf-0005Y9-4o
	for geh-help-gnu-emacs@m.gmane.org; Mon, 30 Dec 2013 02:50:49 -0500
Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58703)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <guivho@gmail.com>) id 1VxXcL-0005UN-D7
	for help-gnu-emacs@gnu.org; Mon, 30 Dec 2013 02:50:34 -0500
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <guivho@gmail.com>) id 1VxXcG-0000CT-8D
	for help-gnu-emacs@gnu.org; Mon, 30 Dec 2013 02:50:29 -0500
Original-Received: from mail-ee0-x234.google.com ([2a00:1450:4013:c00::234]:48541)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <guivho@gmail.com>) id 1VxXcG-0000CN-0m
	for help-gnu-emacs@gnu.org; Mon, 30 Dec 2013 02:50:24 -0500
Original-Received: by mail-ee0-f52.google.com with SMTP id d17so4922132eek.39
	for <help-gnu-emacs@gnu.org>; Sun, 29 Dec 2013 23:50:23 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:references:date:in-reply-to:message-id
	:user-agent:mime-version:content-type;
	bh=+nkrw9MKsRTi52uYanO42XsRZDf5HuFDAwScTp150Ac=;
	b=ZICubx9IsntR0C0oCkoRe0dzvijtMDuV7pL2A+aP5ELXdkHmQDKuEFBavFM5dOOggE
	CWDKa4aMZYo3ZizMUiSZLTQ6c9H3pouH2Er+G6kGy+hL8S8pyDGfd96Iqb6zCnPUg8Kp
	RA/BTCgiHOESJEN442/Ed1vWGYxdDoM0p+SExM+V5fbW0DaSyeThcHhKWqpr3h+uzipu
	aWt6J02W8D0ZMEBpb7kAWVHS6mRTpnx5gxu/58/7IGCDHBffwDLo3fqU6CgT0GeTiIGR
	9h5DWzReUDGOXva2MwHvYXHr+OmGy8T8MmDpaP+72RqMwYOjI8U5e/buc6lVKRHNbhJo
	LSAw==
X-Received: by 10.15.67.142 with SMTP id u14mr275777eex.59.1388389823097;
	Sun, 29 Dec 2013 23:50:23 -0800 (PST)
Original-Received: from zac-3.local.vanhoecke.org (78-20-180-173.access.telenet.be.
	[78.20.180.173])
	by mx.google.com with ESMTPSA id v7sm106246375eel.2.2013.12.29.23.50.21
	for <multiple recipients>
	(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Sun, 29 Dec 2013 23:50:21 -0800 (PST)
In-Reply-To: <1c364789-c247-433d-a306-35a7da0f4da6@default> (Drew Adams's
	message of "Sun, 29 Dec 2013 14:04:05 -0800 (PST)")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin)
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
	(bad octet value).
X-Received-From: 2a00:1450:4013:c00::234
X-BeenThere: help-gnu-emacs@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/help-gnu-emacs>,
	<mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/help-gnu-emacs>
List-Post: <mailto:help-gnu-emacs@gnu.org>
List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/help-gnu-emacs>,
	<mailto:help-gnu-emacs-request@gnu.org?subject=subscribe>
Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org
Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org
Xref: news.gmane.org gmane.emacs.help:95192
Archived-At: <http://permalink.gmane.org/gmane.emacs.help/95192>

Hi Drew,

Drew Adams <drew.adams@oracle.com> writes:

>> > Hi all, I've run into the dreaded `Text is read-only` bug which stops
>> > eshell from closing and Emacs from exiting. I got this in a previous
>> > version of Emacs and fixed it with the following snippet:
>> 
>> I just hit the problem today. I'd say it occurs once a month at the
>> most.
>>
>> Although it does not happen frequently, I sure would like to get it
>> solved. There's only one solution afaik, and that's just killing emacs,
>> as in `kill -9 emacs_pid`. This is drastic, but the only way I know to
>> get rid of the buffer :(
>> 
>> Any suggestion and/or help would be really appreciated!
>
> The standard error that shows that error message is `text-read-only'.
> (See (elisp) `Standard Errors'.)
>
> You could try wrapping whatever code you use that ends up calling
> calling code that raises the error with this:
>
> (condition-case handle-text-read-only
>   ... ; Your code that leads to the error goes here
>   (text-read-only (debug)))

Unfortunately I have no idea what code is causing the bug, and right now
there's not enough time to hunt down an annoying but infrequent
bug. I'll keep your suggestions in my archive. That way I'll be able to
use them when any of the above condition change.

> That should put you in the debugger whenever that error is raised.
> From there you can evaluate expressions (using `e') to possibly
> get more info about what the problem (cause) is.
>
> Note that this is a subcategory of standard error `buffer-read-only'.
> It arises when something tries to modify a character that has text
> property `read-only' (see (elisp) `Text Properties').
>
> You can also just try setting `debug-on-error' to t, in which case
> the debugger should be entered for any error.

I'll try that one.

> However you get to the debugger, it provides a backtrace of the
> functions that led to the error.  With that knowledge, you can
> use `debug-on-entry FUNCTION', to instead enter the debugger for
> a FUNCTION you see on the backtrace stack, and then step through
> its evaluation using `d'.  That will give you a better idea of
> what's going on.


Thanks for your help,

Guido