local-variable-if-set-p

local-variable-if-set-p is a built-in function in `C source code'.

(local-variable-if-set-p VARIABLE &optional BUFFER)

Non-nil if VARIABLE is local in buffer BUFFER when set there.
BUFFER defaults to the current buffer.

More precisely, return non-nil if either VARIABLE already has a local
value in BUFFER, or if VARIABLE is automatically buffer-local (see
`make-variable-buffer-local').