I want to set a key in emacs to perform a shell command on the file in the buffer, and revert the buffer without prompting. The shell command is: p4 edit \'currentfilename
p4 edit \'currentfilename
Maybe using the minor mode "auto-revert-mode" is an option. Just enable it on the current buffer:
M-x "auto-revert-mode"
and always ensure the buffer is saved, before executing an external command.