diff 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
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/temp342423/kill-comments	Tue Jul 27 22:23:13 2010 -0400
     1.3 @@ -0,0 +1,28 @@
     1.4 +#!/usr/bin/python
     1.5 +
     1.6 +import subprocess
     1.7 +import sys
     1.8 +import os
     1.9 +
    1.10 +target_file = sys.argv[1]
    1.11 +
    1.12 +command =   "emacs -batch -l ~/.emacs-bash " + \
    1.13 +    target_file + \
    1.14 +    " --eval '(kill-comment (count-lines (point-min) (point-max)))'"
    1.15 +
    1.16 +#to load a custom .emacs script (for more syntax support),
    1.17 +#use -l <file> in the above command
    1.18 +
    1.19 +#print command
    1.20 +
    1.21 +fnull = open(os.devnull, 'w')
    1.22 +result = subprocess.call(command, shell = True, stdout = fnull, stderr = fnull)
    1.23 +fnull.close()
    1.24 +
    1.25 +
    1.26 +
    1.27 +
    1.28 +
    1.29 +
    1.30 +
    1.31 +