buffer-file-number

buffer-file-number is a variable defined in `files.el'.
Its value is
nil

  • Automatically becomes permanently buffer-local when set.

Documentation:
The device number and file number of the file visited in the current buffer.
The value is a list of the form (FILENUM DEVNUM).
This pair of numbers uniquely identifies the file.
If the buffer is visiting a new file, the value is nil.