From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: 13963@debbugs.gnu.org
Subject: bug#13963: 24.3; eshell: "Text is read-only" and unresponsive eshell to kill-buffer, C-x C-c and C-x C-q
Date: Sat, 23 Mar 2013 11:23:48 +0100 [thread overview]
Message-ID: <87k3oymn2j.fsf@gmail.com> (raw)
In-Reply-To: <CAHjjW150=ww+2Lt=ogLWyXxD9EwG-KO6xFz2MOPHPYpzp_s8HQ@mail.gmail.com>
Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:
> Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:
>
> Problem with previous patch i sent is that it allow to delete backward
> the space at end of prompt, so what is needed is make the whole prompt
> read-only but the last char (the space) and give to this last char
> rear-nonsticky read-only property.
> This works fine here and fix the bug.
diff --git a/lisp/eshell/em-prompt.el b/lisp/eshell/em-prompt.el
index c1c4d47..db6d74c 100644
--- a/lisp/eshell/em-prompt.el
+++ b/lisp/eshell/em-prompt.el
@@ -117,12 +117,17 @@ arriving, or after."
(run-hooks 'eshell-before-prompt-hook)
(if (not eshell-prompt-function)
(set-marker eshell-last-output-end (point))
- (let ((prompt (funcall eshell-prompt-function)))
+ (let* ((prompt (funcall eshell-prompt-function))
+ (len (length prompt)))
(and eshell-highlight-prompt
- (add-text-properties 0 (length prompt)
+ (add-text-properties 0 (1- len)
+ '(read-only t
+ face eshell-prompt)
+ prompt)
+ (add-text-properties (1- len) len
'(read-only t
face eshell-prompt
- rear-nonsticky (face read-only))
+ rear-nonsticky (face read-only))
prompt))
(eshell-interactive-print prompt)))
(run-hooks 'eshell-after-prompt-hook))
--
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997
next prev parent reply other threads:[~2013-03-23 10:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-14 19:34 bug#13963: 24.3; eshell: "Text is read-only" and unresponsive eshell to kill-buffer, C-x C-c and C-x C-q joe M
2013-03-15 7:34 ` Thierry Volpiatto
2013-03-17 12:18 ` Thierry Volpiatto
2013-03-23 10:05 ` Thierry Volpiatto
2013-03-23 10:23 ` Thierry Volpiatto [this message]
2013-03-17 14:47 ` Thierry Volpiatto
2013-03-23 15:58 ` Stefan Monnier
2013-03-23 16:27 ` Thierry Volpiatto
2013-03-26 0:42 ` Stefan Monnier
2013-03-30 2:13 ` Glenn Morris
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k3oymn2j.fsf@gmail.com \
--to=thierry.volpiatto@gmail.com \
--cc=13963@debbugs.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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).