elisp: call command on current file

后端 未结 2 1948
粉色の甜心
粉色の甜心 2021-02-20 05:56

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

2条回答
  •  [愿得一人]
    2021-02-20 06:10

    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.

提交回复
热议问题