Mercurial > laserkard
comparison temp342423/kill-comments @ 102:8ed3394e6b73 laserkard
wrote comment-killer
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Tue, 27 Jul 2010 22:23:13 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
101:2bec541ef58f | 102:8ed3394e6b73 |
---|---|
1 #!/usr/bin/python | |
2 | |
3 import subprocess | |
4 import sys | |
5 import os | |
6 | |
7 target_file = sys.argv[1] | |
8 | |
9 command = "emacs -batch -l ~/.emacs-bash " + \ | |
10 target_file + \ | |
11 " --eval '(kill-comment (count-lines (point-min) (point-max)))'" | |
12 | |
13 #to load a custom .emacs script (for more syntax support), | |
14 #use -l <file> in the above command | |
15 | |
16 #print command | |
17 | |
18 fnull = open(os.devnull, 'w') | |
19 result = subprocess.call(command, shell = True, stdout = fnull, stderr = fnull) | |
20 fnull.close() | |
21 | |
22 | |
23 | |
24 | |
25 | |
26 | |
27 | |
28 |