all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Guido Van Hoecke <guivho@gmail.com>
To: Drew Adams <drew.adams@oracle.com>
Cc: deech <aditya.siram@gmail.com>, help-gnu-emacs@gnu.org
Subject: Re: Eshell - `Text is read-only`
Date: Mon, 30 Dec 2013 08:50:18 +0100	[thread overview]
Message-ID: <m2iou6n5fp.fsf@gmail.com> (raw)
In-Reply-To: <1c364789-c247-433d-a306-35a7da0f4da6@default> (Drew Adams's message of "Sun, 29 Dec 2013 14:04:05 -0800 (PST)")

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



      reply	other threads:[~2013-12-30  7:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-29 18:47 Eshell - `Text is read-only` deech
2013-12-29 21:40 ` Guido Van Hoecke
2013-12-29 22:04   ` Drew Adams
2013-12-30  7:50     ` Guido Van Hoecke [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2iou6n5fp.fsf@gmail.com \
    --to=guivho@gmail.com \
    --cc=aditya.siram@gmail.com \
    --cc=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.