view 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
line wrap: on
line source
1 #!/usr/bin/python
3 import subprocess
4 import sys
5 import os
7 target_file = sys.argv[1]
9 command = "emacs -batch -l ~/.emacs-batch " + \
10 target_file + \
11 " --eval '(kill-comment (count-lines (point-min) (point-max)))'" + \
12 " -f save-buffer"
14 #to load a custom .emacs script (for more syntax support),
15 #use -l <file> in the above command
17 #print command
19 fnull = open(os.devnull, 'w')
20 subprocess.call(command, shell = True, stdout = fnull, stderr = fnull)
21 fnull.close()