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

> > 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)))

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.



  reply	other threads:[~2013-12-29 22:04 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 [this message]
2013-12-30  7:50     ` Guido Van Hoecke

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=1c364789-c247-433d-a306-35a7da0f4da6@default \
    --to=drew.adams@oracle.com \
    --cc=aditya.siram@gmail.com \
    --cc=guivho@gmail.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.