views:

41

answers:

1

i would like to create a shortcut key for emacs to execute this command:

cscript example //C:Perlscript

with example.pl being the perl script that i want to execute

i already got a shortcut key for executing perl: (global-set-key (kbd "") 'perl-eval) how do i make this?

+2  A: 

Try this

(defun run-command () "Run hard coded shell command" (interactive)
   (shell-command (concat "cscript " buffer-file-name " //C:Perlscript")))
(global-set-key (kbd "<f2>") 'run-command)
thats almost what i need, now the "example" should be replaced by the current active file, do you understand what i mean?
Berty