Subject: Re: bug#12838: pcomplete on a path with ~ in eshell fails with "Text is read-only"

From: Glenn Morris <[email-masked]>
Date: Thu, 08 Nov 2012 21:11:26 -0500

Tuomas Kuismin wrote:

> Reproducing:
> + Start emacs with "emacs -Q"
> + Start eshell with M-x eshell
> + Ignore case in eshell completion with M-x set-variable -> eshell-cmpl-ignore-case -> t
> + Exit eshell with the command "exit"
> + Restart eshell with M-x eshell

aka
emacs -Q --eval '(setq eshell-cmpl-ignore-case t)' -f eshell

> + Create a file in your home directory with the command "touch ~/foo"
> + Try to complete said file (in eshell) by typing "cat ~/f" and pressing TAB
>
> Result: No completion is done, message "Text is read-only" appears.

Thanks for the report, with similar symptoms to the closed
http://debbugs.gnu.org/5067.

This is a bug in pcomplete-insert-entry, which tries to delete
"/home/user/f" from a buffer that contains only "~/f", and so ends up
trying to delete the read-only prompt. There is a FIXME comment in the
source about this...

It works fine in 23.4, not in 24.1 and later.