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