Formatting change
[bpt/emacs.git] / src / lread.c
index 279f64a..60e0606 100644 (file)
@@ -160,7 +160,11 @@ static Lisp_Object read0 (), read1 (), read_list (), read_vector ();
 
 DEFUN ("read-char", Fread_char, Sread_char, 0, 0, 0,
   "Read a character from the command input (keyboard or macro).\n\
-It is returned as a number.")
+It is returned as a number.\n\
+If the user generates an event which is not a character (i.e. a mouse\n\
+click or function key event), `read-char' signals an error.  If you\n\
+want to read non-character events, or ignore them, call `read-event'\n\
+or `read-char-exclusive' instead.")
   ()
 {
   register Lisp_Object val;
@@ -179,7 +183,6 @@ It is returned as a number.")
   return val;
 }
 
-#ifdef HAVE_X_WINDOWS
 DEFUN ("read-event", Fread_event, Sread_event, 0, 0, 0,
   "Read an event object from the input stream.")
   ()
@@ -189,7 +192,6 @@ DEFUN ("read-event", Fread_event, Sread_event, 0, 0, 0,
   val = read_char (0);
   return val;
 }
-#endif
 
 DEFUN ("read-char-exclusive", Fread_char_exclusive, Sread_char_exclusive, 0, 0, 0,
   "Read a character from the command input (keyboard or macro).\n\
@@ -199,9 +201,11 @@ It is returned as a number.  Non character events are ignored.")
   register Lisp_Object val;
 
 #ifndef standalone
-  val = read_char (0);
-  while (XTYPE (val) != Lisp_Int)
-    val = read_char (0);
+  do
+    {
+      val = read_char (0);
+    }
+  while (XTYPE (val) != Lisp_Int);
 #else
   val = getchar ();
 #endif
@@ -1468,9 +1472,10 @@ defvar_lisp_nopro (namestring, address, doc)
  the current buffer.  address is the address of the slot in the buffer that is current now. */
 
 void
-defvar_per_buffer (namestring, address, doc)
+defvar_per_buffer (namestring, address, type, doc)
      char *namestring;
      Lisp_Object *address;
+     Lisp_Object type;
      char *doc;
 {
   Lisp_Object sym;
@@ -1483,6 +1488,7 @@ defvar_per_buffer (namestring, address, doc)
   XSET (XSYMBOL (sym)->value, Lisp_Buffer_Objfwd,
        (Lisp_Object *) offset);
   *(Lisp_Object *)(offset + (char *)&buffer_local_symbols) = sym;
+  *(Lisp_Object *)(offset + (char *)&buffer_local_types) = type;
   if (*(int *)(offset + (char *)&buffer_local_flags) == 0)
     /* Did a DEFVAR_PER_BUFFER without initializing the corresponding
        slot of buffer_local_flags */
@@ -1565,9 +1571,7 @@ syms_of_lread ()
   defsubr (&Seval_region);
   defsubr (&Sread_char);
   defsubr (&Sread_char_exclusive);
-#ifdef HAVE_X_WINDOWS
   defsubr (&Sread_event);
-#endif /* HAVE_X_WINDOWS */
   defsubr (&Sget_file_char);
   defsubr (&Smapatoms);