[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#13963: 24.3; eshell: "Text is read-only" and unresponsive eshell to

From: Thierry Volpiatto
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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Thierry Volpiatto <address@hidden> writes:

> Thierry Volpiatto <address@hidden> 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))
       (eshell-interactive-print prompt)))
   (run-hooks 'eshell-after-prompt-hook))

Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]