add sanity check: is buffer visiting a file?