From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: Eshell - `Text is read-only` Date: Sun, 29 Dec 2013 14:04:05 -0800 (PST) Message-ID: <1c364789-c247-433d-a306-35a7da0f4da6@default> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1388354685 24426 80.91.229.3 (29 Dec 2013 22:04:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 29 Dec 2013 22:04:45 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Guido Van Hoecke , deech Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Dec 29 23:04:50 2013 Return-path: 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 ) id 1VxOTZ-0005f1-BI for geh-help-gnu-emacs@m.gmane.org; Sun, 29 Dec 2013 23:04:49 +0100 Original-Received: from localhost ([::1]:56376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VxOTY-0001pI-Py for geh-help-gnu-emacs@m.gmane.org; Sun, 29 Dec 2013 17:04:48 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34539) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VxOT9-0001bW-3j for help-gnu-emacs@gnu.org; Sun, 29 Dec 2013 17:04:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VxOT0-0007Rp-Hk for help-gnu-emacs@gnu.org; Sun, 29 Dec 2013 17:04:23 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:45753) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VxOT0-0007Ri-AH for help-gnu-emacs@gnu.org; Sun, 29 Dec 2013 17:04:14 -0500 Original-Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id rBTM4BjG023821 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 29 Dec 2013 22:04:12 GMT Original-Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rBTM4Bv1009115 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 29 Dec 2013 22:04:11 GMT Original-Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rBTM4AAr009112; Sun, 29 Dec 2013 22:04:10 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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:95184 Archived-At: > > 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: >=20 > 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 :( >=20 > 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))) 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. 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.