#include "paths.h"
#include "commands.h"
#include "keyboard.h"
+#include "termhooks.h"
#endif
#ifdef lint
Lisp_Object Qread_char, Qget_file_char, Qstandard_input;
Lisp_Object Qvariable_documentation, Vvalues, Vstandard_input, Vafter_load_alist;
+Lisp_Object Qascii_character;
+
+extern Lisp_Object Qevent_symbol_element_mask;
/* non-zero if inside `load' */
int load_in_progress;
if (! NILP (delayed_switch_frame))
unread_switch_frame = delayed_switch_frame;
- /* Only ASCII characters are acceptable. */
+ /* Only ASCII characters are acceptable.
+ But convert certain symbols to their ASCII equivalents. */
+ if (XTYPE (val) == Lisp_Symbol)
+ {
+ Lisp_Object tem, tem1, tem2;
+ tem = Fget (val, Qevent_symbol_element_mask);
+ if (!NILP (tem))
+ {
+ tem1 = Fget (Fcar (tem), Qascii_character);
+ /* Merge this symbol's modifier bits
+ with the ASCII equivalent of its basic code. */
+ if (!NILP (tem1))
+ XFASTINT (val) = XINT (tem1) | XINT (Fcar (Fcdr (tem)));
+ }
+ }
if (XTYPE (val) != Lisp_Int)
{
unread_command_events = Fcons (val, Qnil);
- error ("Object read was not a character");
+ error ("Non-character input-event");
}
}
#else
{
val = read_char (0, 0, 0, Qnil, 0);
+ /* Convert certain symbols (for keys like RET, DEL, TAB)
+ to ASCII integers. */
+ if (XTYPE (val) == Lisp_Symbol)
+ {
+ Lisp_Object tem, tem1;
+ tem = Fget (val, Qevent_symbol_element_mask);
+ if (!NILP (tem))
+ {
+ tem1 = Fget (Fcar (tem), Qascii_character);
+ /* Merge this symbol's modifier bits
+ with the ASCII equivalent of its basic code. */
+ if (!NILP (tem1))
+ XFASTINT (val) = XINT (tem1) | XINT (Fcar (Fcdr (tem)));
+ }
+ }
if (XTYPE (val) == Lisp_Int)
break;
Lisp_Object stream;
{
fclose (*(FILE **) XSTRING (stream));
- free (XPNTR (stream));
+ xfree (XPNTR (stream));
if (--load_in_progress < 0) load_in_progress = 0;
return Qnil;
}
c = READCHAR;
if (c == '\\')
c = read_escape (readcharfun);
- return c | CHAR_META;
+ return c | meta_modifier;
case 'S':
c = READCHAR;
c = READCHAR;
if (c == '\\')
c = read_escape (readcharfun);
- return c | CHAR_SHIFT;
+ return c | shift_modifier;
+
+ case 'H':
+ c = READCHAR;
+ if (c != '-')
+ error ("Invalid escape character syntax");
+ c = READCHAR;
+ if (c == '\\')
+ c = read_escape (readcharfun);
+ return c | hyper_modifier;
+
+ case 'A':
+ c = READCHAR;
+ if (c != '-')
+ error ("Invalid escape character syntax");
+ c = READCHAR;
+ if (c == '\\')
+ c = read_escape (readcharfun);
+ return c | alt_modifier;
+
+ case 's':
+ c = READCHAR;
+ if (c != '-')
+ error ("Invalid escape character syntax");
+ c = READCHAR;
+ if (c == '\\')
+ c = read_escape (readcharfun);
+ return c | super_modifier;
case 'C':
c = READCHAR;
else if ((c & 0177) >= 0100 && (c & 0177) <= 0137)
return (c & (037 | ~0177));
else
- return c | CHAR_CTL;
+ return c | ctrl_modifier;
case '0':
case '1':
Qget_file_char = intern ("get-file-char");
staticpro (&Qget_file_char);
+
+ Qascii_character = intern ("ascii-character");
+ staticpro (&Qascii_character);
}