- sym = indirect_variable (XSYMBOL (variable));
- XSETSYMBOL (variable, sym);
-
- /* Look in local_var_list */
- result = Fassoc (variable, buf->local_var_alist);
- if (NILP (result))
- {
- int offset, idx;
- int found = 0;
-
- /* Look in special slots */
- /* buffer-local Lisp variables start at `undo_list',
- tho only the ones from `name' on are GC'd normally. */
- for (offset = PER_BUFFER_VAR_OFFSET (undo_list);
- offset < sizeof (struct buffer);
- /* sizeof EMACS_INT == sizeof Lisp_Object */
- offset += (sizeof (EMACS_INT)))
- {
- idx = PER_BUFFER_IDX (offset);
- if ((idx == -1 || PER_BUFFER_VALUE_P (buf, idx))
- && SYMBOLP (PER_BUFFER_SYMBOL (offset))
- && EQ (PER_BUFFER_SYMBOL (offset), variable))
- {
- result = PER_BUFFER_VALUE (buf, offset);
- found = 1;
- break;
- }
- }
-
- if (!found)
- result = Fdefault_value (variable);
- }
- else