我希望在emacs中设置一个键,以便在缓冲区中执行shell命令,并在不提示的情况下还原缓冲区。 shell命令是:p4 edit 'currentfilename.ext'
(global-set-key [\C-E] (funcall 'revert-buffer 1 1 1))
;; my attempt above to call revert-buffer with a non-nil
;; argument (ignoring the shell command for now) -- get an init error:
;; Error in init file: error: "Buffer does not seem to be associated with any file"
我完全不了解elisp。从emacs手册中,这是revert-buffer的定义:
Command: revert-buffer &optional ignore-auto noconfirm preserve-modes
谢谢!