Created
February 3, 2015 20:11
-
-
Save ffevotte/20285943998c12aab27b to your computer and use it in GitHub Desktop.
Snippet for StackOverflow comment (http://stackoverflow.com/a/13632665/1225607)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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