[gnu.emacs.bug] Feature request for V19

rlk@THINK.COM (Robert L. Krawitz) (07/09/89)

Don't know if this is too late, or if I've said this before, or if
this is the right list, but here goes...

I would like the first C-g (interrupt) typed while emacs is running a
long command to be intercepted synchronously.  That is, it does not
take effect until emacs next attempts to read from its input stream.
Two consecutive C-g's should be intercepted asynchronously, having the
effect of a single C-g currently (interrupts the current command when
it is safe to do so).  Three C-g's should have the effect that two do
currently (forcibly interrupt emacs, and prompt for autosave and
coredump).

This may be tricky to implement with the standard terminal-based I/O
subsystem.  Under X, it could be implemented by pushing the first C-g
on the input queue, and setting a flag.  If the flag is set, C-g
behaves as it does currently, generating a SIGINT or whatever.  Any
key other than C-g clears the flag.

Sample usage:

I have just typed s to save my rmail buffer.  I then typed i to read
in another rmail file, but before completing this and before the first
rmail buffer has finished saving I realize that I didn't want to get
the second rmail buffer, but instead I wanted to output the current
message to a third rmail file.  I would like to type C-g to kill the
rmail-input command and then type o to save to the third file.

This is not an "essential" feature, as I can wait a few seconds for
the first file to save.  However, it breaks my train of thought to
wait at that point, as I have just decided that I want to do something
different.  I cannot type C-g at that point because it will interrupt
the save in the middle.

ames >>>>>>>>>  |	Robert Krawitz <rlk@think.com>	245 First St.
bloom-beacon >  |think!rlk				Cambridge, MA  02142
harvard >>>>>>  .	Thinking Machines Corp.		(617)876-1111