All pastes #737821 Raw Edit

keybinding with a func in elisp

public text v1 · immutable
·published 2007-10-15 19:06 UTC
rendered paste body
;;run the current perl program
(defun run-perl ()
  (interactive)
  (setq perl-buffer-name buffer-file-name)
  (shell-command (concat "perl " perl-buffer-name))
)
(add-hook 'cperl-mode-hook
 (lambda ()
  (local-set-key (kbd "C-p r") 'run-perl)))