idlwave-shell-input-mode-spells

idlwave-shell-input-mode-spells is a variable defined in `idlw-shell.el'.
Its value is
("^$" "^$" "^$")


Documentation:
The three regular expressions which match the magic spells for input modes.

When the first regexp matches in the output stream of IDL, IDLWAVE
prompts for a single character and sends it immediately to IDL, similar
to the command M-x idlwave-shell-send-char.

When the second regexp matches, IDLWAVE switches to a blocking
single-character input mode. This is the same mode which can be entered
manually with M-x idlwave-shell-char-mode-loop.
This input mode exits when the third regexp matches in the output,
or when the IDL prompt is encountered.

The variable `idlwave-shell-use-input-mode-magic' must be non-nil to enable
scanning for these expressions. If the IDL program produces lots of
output, shell operation may be slowed down.

This mechanism is useful for correct interaction with the IDL function
GET_KBRD, because in normal operation IDLWAVE only sends \n terminated
strings. Here is some example code which makes use of the default spells.

print,'' ; Make IDLWAVE switch to character mode
REPEAT BEGIN
A = GET_KBRD(1)
PRINT, BYTE(A)
ENDREP UNTIL A EQ 'q'
print,'
' ; Make IDLWAVE switch back to line mode

print,'Quit the program, y or n?'
print,'' ; Ask IDLWAVE to send one character
answer = GET_KBRD(1)

Since the IDLWAVE shell defines the system variable `!IDLWAVE_VERSION',
you could actually check if you are running under Emacs before printing
the magic strings. Here is a procedure which uses this.

Usage:
======
idlwave_char_input ; Make IDLWAVE send one character
idlwave_char_input,/on ; Start the loop to send characters
idlwave_char_input,/off ; End the loop to send characters


pro idlwave_char_input,on=on,off=off
;; Test if we are running under Emacs
defsysv,'!idlwave_version',exists=running_emacs
if running_emacs then begin
if keyword_set(on) then print,'' $
else if keyword_set(off) then print,'
' $
else print,''
endif
end

You can customize this variable.