all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Guido Van Hoecke <guivho@gmail.com>
To: deech <aditya.siram@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Eshell - `Text is read-only`
Date: Sun, 29 Dec 2013 22:40:34 +0100	[thread overview]
Message-ID: <m2mwjjmj3h.fsf@gmail.com> (raw)
In-Reply-To: <d76e2299-abc0-4404-b8ba-797fb3894dfc@googlegroups.com> (deech's message of "Sun, 29 Dec 2013 10:47:55 -0800 (PST)")

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.



  reply	other threads:[~2013-12-29 21:40 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 [this message]
2013-12-29 22:04   ` Drew Adams
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=m2mwjjmj3h.fsf@gmail.com \
    --to=guivho@gmail.com \
    --cc=aditya.siram@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.