Mercurial > laserkard
annotate kill-comments @ 105:3c398dd94f17 laserkard
saving for transfer
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Mon, 27 Sep 2010 17:47:08 -0400 |
parents | 52297178e0eb |
children |
rev | line source |
---|---|
rlm@103 | 1 #!/usr/bin/python |
rlm@102 | 2 |
rlm@102 | 3 import subprocess |
rlm@102 | 4 import sys |
rlm@103 | 5 import os |
rlm@102 | 6 |
rlm@102 | 7 target_file = sys.argv[1] |
rlm@102 | 8 |
rlm@103 | 9 command = "emacs -batch -l ~/.emacs-batch " + \ |
rlm@102 | 10 target_file + \ |
rlm@103 | 11 " --eval '(kill-comment (count-lines (point-min) (point-max)))'" + \ |
rlm@103 | 12 " -f save-buffer" |
rlm@102 | 13 |
rlm@103 | 14 #to load a custom .emacs script (for more syntax support), |
rlm@103 | 15 #use -l <file> in the above command |
rlm@103 | 16 |
rlm@103 | 17 #print command |
rlm@103 | 18 |
rlm@103 | 19 fnull = open(os.devnull, 'w') |
rlm@103 | 20 subprocess.call(command, shell = True, stdout = fnull, stderr = fnull) |
rlm@103 | 21 fnull.close() |
rlm@103 | 22 |
rlm@103 | 23 |
rlm@103 | 24 |
rlm@103 | 25 |
rlm@103 | 26 |
rlm@103 | 27 |
rlm@103 | 28 |
rlm@103 | 29 |