comparison src/lread.c @ 851:9620f7edf04d

entered into RCS
author Jim Blandy <jimb@redhat.com>
date Wed, 22 Jul 1992 20:59:53 +0000
parents e9b9a1cff2c9
children bf78b5ea9b3a
comparison
equal deleted inserted replaced
850:0bc61321ba50 851:9620f7edf04d
158 158
159 /* get a character from the tty */ 159 /* get a character from the tty */
160 160
161 DEFUN ("read-char", Fread_char, Sread_char, 0, 0, 0, 161 DEFUN ("read-char", Fread_char, Sread_char, 0, 0, 0,
162 "Read a character from the command input (keyboard or macro).\n\ 162 "Read a character from the command input (keyboard or macro).\n\
163 It is returned as a number.") 163 It is returned as a number.\n\
164 If the user generates an event which is not a character (i.e. a mouse\n\
165 click or function key event), `read-char' signals an error. If you\n\
166 want to read non-character events, or ignore them, call `read-event'\n\
167 or `read-char-exclusive' instead.")
164 () 168 ()
165 { 169 {
166 register Lisp_Object val; 170 register Lisp_Object val;
167 171
168 #ifndef standalone 172 #ifndef standalone
177 #endif 181 #endif
178 182
179 return val; 183 return val;
180 } 184 }
181 185
182 #ifdef HAVE_X_WINDOWS
183 DEFUN ("read-event", Fread_event, Sread_event, 0, 0, 0, 186 DEFUN ("read-event", Fread_event, Sread_event, 0, 0, 0,
184 "Read an event object from the input stream.") 187 "Read an event object from the input stream.")
185 () 188 ()
186 { 189 {
187 register Lisp_Object val; 190 register Lisp_Object val;
188 191
189 val = read_char (0); 192 val = read_char (0);
190 return val; 193 return val;
191 } 194 }
192 #endif
193 195
194 DEFUN ("read-char-exclusive", Fread_char_exclusive, Sread_char_exclusive, 0, 0, 0, 196 DEFUN ("read-char-exclusive", Fread_char_exclusive, Sread_char_exclusive, 0, 0, 0,
195 "Read a character from the command input (keyboard or macro).\n\ 197 "Read a character from the command input (keyboard or macro).\n\
196 It is returned as a number. Non character events are ignored.") 198 It is returned as a number. Non character events are ignored.")
197 () 199 ()
198 { 200 {
199 register Lisp_Object val; 201 register Lisp_Object val;
200 202
201 #ifndef standalone 203 #ifndef standalone
202 val = read_char (0); 204 do
203 while (XTYPE (val) != Lisp_Int) 205 {
204 val = read_char (0); 206 val = read_char (0);
207 }
208 while (XTYPE (val) != Lisp_Int);
205 #else 209 #else
206 val = getchar (); 210 val = getchar ();
207 #endif 211 #endif
208 212
209 return val; 213 return val;
1563 defsubr (&Sload); 1567 defsubr (&Sload);
1564 defsubr (&Seval_buffer); 1568 defsubr (&Seval_buffer);
1565 defsubr (&Seval_region); 1569 defsubr (&Seval_region);
1566 defsubr (&Sread_char); 1570 defsubr (&Sread_char);
1567 defsubr (&Sread_char_exclusive); 1571 defsubr (&Sread_char_exclusive);
1568 #ifdef HAVE_X_WINDOWS
1569 defsubr (&Sread_event); 1572 defsubr (&Sread_event);
1570 #endif /* HAVE_X_WINDOWS */
1571 defsubr (&Sget_file_char); 1573 defsubr (&Sget_file_char);
1572 defsubr (&Smapatoms); 1574 defsubr (&Smapatoms);
1573 1575
1574 DEFVAR_LISP ("obarray", &Vobarray, 1576 DEFVAR_LISP ("obarray", &Vobarray,
1575 "Symbol table for use by `intern' and `read'.\n\ 1577 "Symbol table for use by `intern' and `read'.\n\