emacs-devel
[Top][All Lists]
Advanced

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

Re: comint read-only prompt


From: JD Smith
Subject: Re: comint read-only prompt
Date: 21 Aug 2002 19:21:55 -0700

On Wed, 2002-08-21 at 18:57, Richard Stallman wrote:
>     > It seems rather inconsistent to me to make the newest prompt read-only
>     > and not the other prompts.
> 
>     People might want to trim the *shell* buffer, for example to
>     eliminate spurious commands.  Then the modified *shell* buffer can be
>     sent via email to illustrate some point.
> 
> Yes, I agree.  In some cases people might want to edit the last
> prompt, too.  Yet there are also cases (as has been said) where they
> would tend to do so by mistake and it would be useful to prevent them.
> 
> Perhaps instead of trying to distinguish these cases based on which
> prompt is being edited, we should try to distinguish between different
> commands.  For instance, maybe the case that should get an error
> is when point is after the last prompt and you're deleting a region
> that runs back into the last prompt.

That sounds very sensible to me.  The modification-hooks +
insert-in-front-hooks method I originally introduced approximates this. 
If you drop insert-in-front, the user could annotate the beginning of
the line with the last prompt, remove the entire prompt without
complaint, but still be prevented from "backing over" it.  He also
couldn't place the point in the middle of the prompt and edit from
there, but I'm not sure how useful that would be anyway.  If I needed to
edit the last prompt in situ (for instance to remove my hostname), I'd
simply hit return to make it no longer the last line, and edit away.  I
could always C-k the empty prompt line at the end.  Since I'm saved from
accidentally erasing the prompt many many more times than I'm slightly
inconvenienced when I intentionally want to edit it, I think it's a good
trade.

This has the advantage of being held in the overlay, and thus
side-stepping the whole snapshotting dilemma (so long as you ensure that
modification-hooks stays an overlay and does not become a
text-property).  I think 'intangible makes sense here too, to avoid
leaving point inside the prompt.  Is there anyone with more experience
with the comint code who'd like to try implementing this?

Thanks,

JD





reply via email to

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