0
votes

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?

1

1 Answers

2
votes

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)