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: Sun, 29 Dec 2013 22:40:34 +0100
Message-ID: <m2mwjjmj3h.fsf@gmail.com>
References: <d76e2299-abc0-4404-b8ba-797fb3894dfc@googlegroups.com>
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: ger.gmane.org 1388353263 11095 80.91.229.3 (29 Dec 2013 21:41:03 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sun, 29 Dec 2013 21:41:03 +0000 (UTC)
Cc: help-gnu-emacs@gnu.org
To: deech <aditya.siram@gmail.com>
Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Dec 29 22:41:08 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 1VxO6c-0007d6-Md
	for geh-help-gnu-emacs@m.gmane.org; Sun, 29 Dec 2013 22:41:06 +0100
Original-Received: from localhost ([::1]:56338 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 1VxO6c-0006CA-6S
	for geh-help-gnu-emacs@m.gmane.org; Sun, 29 Dec 2013 16:41:06 -0500
Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59790)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <guivho@gmail.com>) id 1VxO6J-0006By-Ls
	for help-gnu-emacs@gnu.org; Sun, 29 Dec 2013 16:40:56 -0500
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <guivho@gmail.com>) id 1VxO6B-0001mI-76
	for help-gnu-emacs@gnu.org; Sun, 29 Dec 2013 16:40:47 -0500
Original-Received: from mail-ee0-x22a.google.com ([2a00:1450:4013:c00::22a]:36750)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <guivho@gmail.com>) id 1VxO6A-0001ly-W5
	for help-gnu-emacs@gnu.org; Sun, 29 Dec 2013 16:40:39 -0500
Original-Received: by mail-ee0-f42.google.com with SMTP id e53so4876051eek.1
	for <help-gnu-emacs@gnu.org>; Sun, 29 Dec 2013 13:40:37 -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=YhN3GzglDtBAnVG/XHVWaneOS0ZiK50LyvkcKs5fLB0=;
	b=tiWfRv5VpwzzQG8jpu/134E0wjM1iNockDQEW2TVXAZRgf/QXGvaHzzYP9OC0RIP69
	c7RI8VIiTohw4bMdC9s/3+5qe5xyGEZSk3YF5iD9sHy8ZgeM5O24ApfWqvaGykR9BVsV
	aD0+eejEVhYSdfFYlEi+S7UJepbv0MFlPTD0An1jXMQC7QDxa/68L1D+/Q/ANNTbcWQ/
	8wFV+6bf19QdO+yFaz/P+4NQOLuDuYiOmNhUOURfyo27g9xmIR0WsSwGP/lst9Ld/3ek
	AmXrwmEgM9kGsx4g+84Pgf1+XayQiIKOp9vyn6kjKQqZmX5lB1sFx1WxMS+2AOhjm9IZ
	BoZQ==
X-Received: by 10.15.42.76 with SMTP id t52mr101593eev.113.1388353237778;
	Sun, 29 Dec 2013 13:40:37 -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 v7sm102968091eel.2.2013.12.29.13.40.36
	for <multiple recipients>
	(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Sun, 29 Dec 2013 13:40:36 -0800 (PST)
In-Reply-To: <d76e2299-abc0-4404-b8ba-797fb3894dfc@googlegroups.com> (deech's
	message of "Sun, 29 Dec 2013 10:47:55 -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::22a
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:95183
Archived-At: <http://permalink.gmane.org/gmane.emacs.help/95183>

deech <aditya.siram@gmail.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:

> (setq eshell-prompt-function
>   (lambda ()
>     (concat (eshell/pwd) "\n$"))
>   eshell-prompt-regexp (concat "^" (regexp-quote "$")))

I just hit the problem today. I'd say it occurs once a month at the
most. My prompt is a two line version. It looks like this:

2013-12-29 22:28 ~/src/gvhperls
$ 

I don't think it is due to the prompt. FWIW, here's my
eshell-prompt-function, which I shamelesly based on snippets collected
on the net:

(setq eshell-prompt-function
      (lambda ()
        (let ((prompt (eshell/pwd))
              (now (format-time-string "\n%Y-%m-%d %H:%M " (current-time)))
              (home-dir (expand-file-name "~")))
          ;; get rid of the nasty backslashes
          (while (string-match "\\\\" home-dir)
            (setq home-dir (replace-match "/" nil t home-dir)))

          ;; match home-dir at the begining of the line
          ;; be careful not to match `/users/foo.old' if $HOME is `/users/foo'
          (if (string-match
               (concat "^\\(" home-dir "\\)\\(/.*\\)?$")
               prompt)

              (setq prompt (replace-match
                            (if (and (match-string 2))
                                "~\\2"
                              "~")
                            nil
                            nil
                            prompt
                            0)))

          ;; return the prompt
          ;;   -tack on $ or # depending on user id
          (concat now prompt
                  (if (= (user-uid) 0) "\n# " "\n$ ")))))


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!

TIA, and a happy and healthy new-year to you all :)


Guido

--
The world needs more people like us and fewer like them.