/[emacs]/emacs/src/data.c
ViewVC logotype

Diff of /emacs/src/data.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.226 by miles, Mon Sep 1 15:45:52 2003 UTC revision 1.227 by rms, Fri Sep 19 14:34:30 2003 UTC
# Line 1706  BUFFER defaults to the current buffer. Line 1706  BUFFER defaults to the current buffer.
1706      {      {
1707        Lisp_Object tail, elt;        Lisp_Object tail, elt;
1708    
       variable = indirect_variable (variable);  
1709        for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail))        for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail))
1710          {          {
1711            elt = XCAR (tail);            elt = XCAR (tail);
# Line 1765  BUFFER defaults to the current buffer. Line 1764  BUFFER defaults to the current buffer.
1764      }      }
1765    return Qnil;    return Qnil;
1766  }  }
1767    
1768    DEFUN ("variable-binding-locus", Fvariable_binding_locus, Svariable_binding_locus,
1769           1, 1, 0,
1770           doc: /* Return a value indicating where VARIABLE's current binding comes from.
1771    If the current binding is buffer-local, the value is the current buffer.
1772    If the current binding is frame-local, the value is the selected frame.
1773    If the current binding is global (the default), the value is nil.  */)
1774         (variable)
1775         register Lisp_Object variable;
1776    {
1777      Lisp_Object valcontents;
1778    
1779      CHECK_SYMBOL (variable);
1780      variable = indirect_variable (variable);
1781    
1782      /* Make sure the current binding is actually swapped in.  */
1783      find_symbol_value (variable);
1784    
1785      valcontents = XSYMBOL (variable)->value;
1786    
1787      if (BUFFER_LOCAL_VALUEP (valcontents)
1788          || SOME_BUFFER_LOCAL_VALUEP (valcontents)
1789          || BUFFER_OBJFWDP (valcontents))
1790        {
1791          /* For a local variable, record both the symbol and which
1792             buffer's or frame's value we are saving.  */
1793          if (!NILP (Flocal_variable_p (variable, Qnil)))
1794            return Fcurrent_buffer ();
1795          else if (!BUFFER_OBJFWDP (valcontents)
1796                   && XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame)
1797            return XBUFFER_LOCAL_VALUE (valcontents)->frame;
1798        }
1799    
1800      return Qnil;
1801    }
1802    
1803  /* Find the function at the end of a chain of symbol function indirections.  */  /* Find the function at the end of a chain of symbol function indirections.  */
1804    
# Line 3185  syms_of_data () Line 3219  syms_of_data ()
3219    defsubr (&Smake_variable_frame_local);    defsubr (&Smake_variable_frame_local);
3220    defsubr (&Slocal_variable_p);    defsubr (&Slocal_variable_p);
3221    defsubr (&Slocal_variable_if_set_p);    defsubr (&Slocal_variable_if_set_p);
3222      defsubr (&Svariable_binding_locus);
3223    defsubr (&Saref);    defsubr (&Saref);
3224    defsubr (&Saset);    defsubr (&Saset);
3225    defsubr (&Snumber_to_string);    defsubr (&Snumber_to_string);

Legend:
Removed from v.1.226  
changed lines
  Added in v.1.227

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26