variable-binding-locus

variable-binding-locus is a built-in function in `C source code'.

(variable-binding-locus VARIABLE)

Return a value indicating where VARIABLE's current binding comes from.
If the current binding is buffer-local, the value is the current buffer.
If the current binding is frame-local, the value is the selected frame.
If the current binding is global (the default), the value is nil.