]> code.delx.au - gnu-emacs/blobdiff - src/data.c
(Fbyte_code): Harmonize arguments with documentation.
[gnu-emacs] / src / data.c
index 3394cdb147c42eb641f8c3390d4bcfbc7dee6a34..b02294301411fb91872622115d69ef32905df00a 100644 (file)
@@ -83,6 +83,7 @@ Lisp_Object Qnumberp, Qnumber_or_marker_p;
 static Lisp_Object Qinteger, Qsymbol, Qstring, Qcons, Qmarker, Qoverlay;
 static Lisp_Object Qfloat, Qwindow_configuration, Qprocess, Qwindow;
 static Lisp_Object Qcompiled_function, Qbuffer, Qframe, Qvector;
+static Lisp_Object Qchar_table, Qbool_vector;
 
 static Lisp_Object swap_in_symval_forwarding ();
 
@@ -228,6 +229,10 @@ for example, (type-of 1) returns `integer'.")
        return Qcompiled_function;
       if (GC_BUFFERP (object))
        return Qbuffer;
+      if (GC_CHAR_TABLE_P (object))
+       return Qchar_table;
+      if (GC_BOOL_VECTOR_P (object))
+       return Qbool_vector;
 
 #ifdef MULTI_FRAME
       if (GC_FRAMEP (object))
@@ -857,7 +862,7 @@ swap_in_symval_forwarding (sym, valcontents)
 \f
 /* Find the value of a symbol, returning Qunbound if it's not bound.
    This is helpful for code which just wants to get a variable's value
-   if it has one, without signalling an error.
+   if it has one, without signaling an error.
    Note that it must not be possible to quit
    within this function.  Great care is required for this.  */
 
@@ -1284,6 +1289,11 @@ Use `make-local-hook' instead.")
   tem = Fassq (sym, current_buffer->local_var_alist);
   if (NILP (tem))
     {
+      /* Swap out any local binding for some other buffer, and make
+        sure the current value is permanently recorded, if it's the
+        default value.  */
+      find_symbol_value (sym);
+
       current_buffer->local_var_alist
         = Fcons (Fcons (sym, XCONS (XCONS (XBUFFER_LOCAL_VALUE (XSYMBOL (sym)->value)->cdr)->cdr)->cdr),
                 current_buffer->local_var_alist);
@@ -1292,7 +1302,9 @@ Use `make-local-hook' instead.")
         force it to look once again for this buffer's value */
       {
        Lisp_Object *pvalbuf;
+
        valcontents = XSYMBOL (sym)->value;
+
        pvalbuf = &XCONS (XBUFFER_LOCAL_VALUE (valcontents)->cdr)->car;
        if (current_buffer == XBUFFER (*pvalbuf))
          *pvalbuf = Qnil;
@@ -2593,6 +2605,8 @@ syms_of_data ()
   Qbuffer = intern ("buffer");
   Qframe = intern ("frame");
   Qvector = intern ("vector");
+  Qchar_table = intern ("char-table");
+  Qbool_vector = intern ("bool-vector");
 
   staticpro (&Qinteger);
   staticpro (&Qsymbol);
@@ -2609,6 +2623,8 @@ syms_of_data ()
   staticpro (&Qbuffer);
   staticpro (&Qframe);
   staticpro (&Qvector);
+  staticpro (&Qchar_table);
+  staticpro (&Qbool_vector);
 
   defsubr (&Seq);
   defsubr (&Snull);