Created
June 6, 2012 15:08
-
-
Save autarch/2882455 to your computer and use it in GitHub Desktop.
This file contains 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 my-perltidy-command () | |
(concat "my-perltidy " | |
(cond | |
((buffer-file-name) (file-truename buffer-file-name)) | |
(t "")))) | |
(defun perltidy-region () | |
"Run perltidy on the current region." | |
(interactive) | |
(save-excursion | |
(shell-command-on-region (point) (mark) (my-perltidy-command) nil t) | |
(cperl-mode))) | |
(defun perltidy-all () | |
"Run perltidy on the current region." | |
(interactive) | |
(let ((p (point))) | |
(save-excursion | |
(shell-command-on-region (point-min) (point-max) (my-perltidy-command) nil t) | |
) | |
(goto-char p) | |
(cperl-mode))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment