+ return Fsignal (Qvoid_variable, Fcons (variable, Qnil));
+
+ return result;
+}
+
+/* Return an alist of the Lisp-level buffer-local bindings of
+ buffer BUF. That is, don't include the variables maintained
+ in special slots in the buffer object. */
+
+static Lisp_Object
+buffer_lisp_local_variables (buf)
+ struct buffer *buf;
+{
+ Lisp_Object result = Qnil;
+ register Lisp_Object tail;
+ for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail))
+ {
+ Lisp_Object val, elt;
+
+ elt = XCAR (tail);
+
+ /* Reference each variable in the alist in buf.
+ If inquiring about the current buffer, this gets the current values,
+ so store them into the alist so the alist is up to date.
+ If inquiring about some other buffer, this swaps out any values
+ for that buffer, making the alist up to date automatically. */
+ val = find_symbol_value (XCAR (elt));
+ /* Use the current buffer value only if buf is the current buffer. */
+ if (buf != current_buffer)
+ val = XCDR (elt);
+
+ /* If symbol is unbound, put just the symbol in the list. */
+ if (EQ (val, Qunbound))
+ result = Fcons (XCAR (elt), result);
+ /* Otherwise, put (symbol . value) in the list. */
+ else
+ result = Fcons (Fcons (XCAR (elt), val), result);
+ }