[Top][All Lists]

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

comint read-only prompt

From: Marshall, Simon
Subject: comint read-only prompt
Date: Mon, 19 Aug 2002 09:24:07 +0100

Hi guys, this one is for you...

-----Original Message-----
From: JD Smith [mailto:address@hidden 
Sent: 09 August 2002 00:30
To: address@hidden; address@hidden
Subject: comint read-only prompt

I'm the maintainer of the IDLWAVE programming mode, which uses comint to
run the language IDL interactively (see idlw-shell.el if you're
interested).  Without comint, programming the shell would have been far
more cumbersome.   

One missing feature of comint that I'd always pined for was the ability
to make the most recent prompt (IDL> in my case) read-only.  Right now,
the delete key just runs right over it.  As I looked into it further, I
realized the problem was that an overlay is (usually) used to highlight
this prompt, and that overlays (for whatever reason) do not honor the
'read-only property, as text properties do.  I had hoped Emacs 21 would
address this shortcoming, but it did not.

However, I learned by example in cpp-mode (cpp.el), the overlay
properties `modification-hooks' and `insert-in-front-hooks' can be used
to effect a read-only equivalency, by signaling an error if the user
attempts to modify or pre-pend text in the overlay.

I tried this out on the comint.el which shipped with Emacs 21.2.1, and
it works marvelously.  I used 'intangible in addition so left arrow
would skip right over the prompt (and C-a, etc., would stop before the
prompt).  Would you guys be interested in this type of functionality? 
If so, I could redo the mods against CVS comint, and send them your way
for a look (the major relevant change between 21.2.1 and CVS is in
comint-snapshot-last-prompt, where I need to remove hooks to prevent
older prompts from being read-only, in case you want to delete them). 
Otherwise, I might implement them as advice from within idlw-shell, but
I'd prefer the more robust solution.



 J.D. Smith            <=> 
 Steward Observatory   <=> 520-621-9532 <W>
 University of Arizona <=> 520-621-1532 <F>
 Tucson, Arizona 85721 <=> 

reply via email to

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