Skip to content

Instantly share code, notes, and snippets.

@ffevotte
Created February 3, 2015 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ffevotte/20285943998c12aab27b to your computer and use it in GitHub Desktop.
Save ffevotte/20285943998c12aab27b to your computer and use it in GitHub Desktop.
Snippet for StackOverflow comment (http://stackoverflow.com/a/13632665/1225607)
(defun isend--perl (buf-name)
"Prepend 'x ' to normal perl instructions.
Leave 'print' instructions untouched."
(with-current-buffer buf-name
(goto-char (point-min))
(unless (looking-at "[[:space:]]*print")
(insert "x ")))
(insert-buffer-substring buf-name))
(defun isend-default-perl-setup ()
(when (eq major-mode 'perl-mode)
(set (make-local-variable 'isend-send-line-function) #'isend--perl)))
(add-hook 'isend-mode-hook #'isend-default-perl-setup)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment