emacs: check buffer-file-name for 'reset and 'project commands

Also replace uses of (buffer-file-name) by buffer-file-name