comparison kill-comments @ 103:52297178e0eb laserkard

implemented automatic text resize
author Robert McIntyre <rlm@mit.edu>
date Wed, 28 Jul 2010 06:36:39 -0400
parents 8ed3394e6b73
children
comparison
equal deleted inserted replaced
102:8ed3394e6b73 103:52297178e0eb
1 #!/usr/bin/env python 1 #!/usr/bin/python
2 2
3 import subprocess 3 import subprocess
4 import sys 4 import sys
5 import os
5 6
6 target_file = sys.argv[1] 7 target_file = sys.argv[1]
7 8
8 command = "emacs -batch " + \ 9 command = "emacs -batch -l ~/.emacs-batch " + \
9 target_file + \ 10 target_file + \
10 " --eval '(kill-comment (point-min) (point-max) nil)' -f save-buffer" 11 " --eval '(kill-comment (count-lines (point-min) (point-max)))'" + \
12 " -f save-buffer"
11 13
12 print command 14 #to load a custom .emacs script (for more syntax support),
13 subprocess.call(command, shell=True) 15 #use -l <file> in the above command
16
17 #print command
18
19 fnull = open(os.devnull, 'w')
20 subprocess.call(command, shell = True, stdout = fnull, stderr = fnull)
21 fnull.close()
22
23
24
25
26
27
28
29