+
+DEFUN ("current-input-mode", Fcurrent_input_mode, Scurrent_input_mode, 0, 0, 0,
+ "Return information about the way Emacs currently reads keyboard input.\n\
+The value is a list of the form (INTERRUPT FLOW META QUIT), where\n\
+ INTERRUPT is non-nil if Emacs is using interrupt-driven input; if\n\
+ nil, Emacs is using CBREAK mode.\n\
+ FLOW is non-nil if Emacs uses ^S/^Q flow control for output to the\n\
+ terminal; this does not apply if Emacs uses interrupt-driven input.\n\
+ META is non-nil if Emacs is accepting 8-bit input; otherwise, Emacs\n\
+ clears the eighth bit of every input character.\n\
+ QUIT is the character Emacs currently uses to quit.\n\
+The elements of this list correspond to the arguments of\n\
+set-input-mode.")
+ ()
+{
+ Lisp_Object val[4];
+
+ val[0] = interrupt_input ? Qt : Qnil;
+ val[1] = flow_control ? Qt : Qnil;
+ val[2] = meta_key ? Qt : Qnil;
+ XSETINT (val[3], quit_char);
+
+ return Flist (val, sizeof (val) / sizeof (val[0]));
+}
+