elisp: call command on current file
Posted
by
Jasie
on Stack Overflow
See other posts from Stack Overflow
or by Jasie
Published on 2011-01-15T00:31:36Z
Indexed on
2011/01/15
3:53 UTC
Read the original article
Hit count: 205
Hello,
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.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"
Completely new to elisp. From the emacs manual, here is the definition of revert-buffer:
Command: revert-buffer &optional ignore-auto noconfirm preserve-modes
Thanks!
© Stack Overflow or respective owner