From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.bugs 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 Organization: Emacs Helm Message-ID: <87k3oymn2j.fsf@gmail.com> References: <87a9q5qfou.fsf@gmail.com> <87d2uymd7y.fsf@gmail.com> <87obeamnxe.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1364034306 23724 80.91.229.3 (23 Mar 2013 10:25:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Mar 2013 10:25:06 +0000 (UTC) To: 13963@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 23 11:25:33 2013 Return-path: Envelope-to: geb-bug-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 ) id 1UJLdi-0001WV-H0 for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Mar 2013 11:25:30 +0100 Original-Received: from localhost ([::1]:56470 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJLdK-0003rt-TS for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Mar 2013 06:25:06 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35665) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJLdG-0003qB-FD for bug-gnu-emacs@gnu.org; Sat, 23 Mar 2013 06:25:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UJLdF-0007Ul-7h for bug-gnu-emacs@gnu.org; Sat, 23 Mar 2013 06:25:02 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37500) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJLdF-0007UT-3r for bug-gnu-emacs@gnu.org; Sat, 23 Mar 2013 06:25:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UJLfC-0005i6-2Z for bug-gnu-emacs@gnu.org; Sat, 23 Mar 2013 06:27:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Thierry Volpiatto Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Mar 2013 10:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13963 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.136403437521897 (code B ref -1); Sat, 23 Mar 2013 10:27:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 Mar 2013 10:26:15 +0000 Original-Received: from localhost ([127.0.0.1]:41609 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UJLeR-0005h7-Cb for submit@debbugs.gnu.org; Sat, 23 Mar 2013 06:26:15 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52401) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UJLeP-0005h0-7w for submit@debbugs.gnu.org; Sat, 23 Mar 2013 06:26:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UJLcR-0007Cz-1A for submit@debbugs.gnu.org; Sat, 23 Mar 2013 06:24:11 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:37734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJLcQ-0007Cv-Uv for submit@debbugs.gnu.org; Sat, 23 Mar 2013 06:24:10 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35517) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJLcP-0003lK-TF for bug-gnu-emacs@gnu.org; Sat, 23 Mar 2013 06:24:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UJLcO-0007CU-FB for bug-gnu-emacs@gnu.org; Sat, 23 Mar 2013 06:24:09 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:51210) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJLcO-0007CN-8N for bug-gnu-emacs@gnu.org; Sat, 23 Mar 2013 06:24:08 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UJLcf-0000oj-JY for bug-gnu-emacs@gnu.org; Sat, 23 Mar 2013 11:24:25 +0100 Original-Received: from lbe83-2-78-243-104-167.fbx.proxad.net ([78.243.104.167]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 23 Mar 2013 11:24:25 +0100 Original-Received: from thierry.volpiatto by lbe83-2-78-243-104-167.fbx.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 23 Mar 2013 11:24:25 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 40 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lbe83-2-78-243-104-167.fbx.proxad.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:736mrh+oO2N5xK+xMD67IzY/nww= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:72822 Archived-At: Thierry Volpiatto writes: > Thierry Volpiatto 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