home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / me34exe.zip / mutt / misc / deshar.mut < prev    next >
Text File  |  1995-01-14  |  772b  |  38 lines

  1. (const max-lines-of-junk 70)
  2.  
  3. (include "me.mh")
  4.  
  5. (defun
  6.   MAIN { (bind-to-key "deshar" "`") }
  7.   deshar
  8.   {
  9.     (int n)
  10.  
  11.     (beginning-of-buffer)(set-mark)
  12.     (for (n 0) (< n max-lines-of-junk) (+= n 1)
  13.     {
  14.       (if (looking-at '#') { (delete-region)(msg n " lines of junk.") (done) })
  15.       (forward-line 1)
  16.     })
  17.     (msg "Couldn't find a sh comment line after " n " lines!  Phooie")
  18.     (halt)
  19.   }
  20.   deshar-lots-of-files
  21.   {
  22.     (int part)
  23.     (string base-name)
  24.  
  25.     (part 1)
  26.     (base-name (complete CC_FNAME 
  27.       "Base name (each part is in form <base-name><n>): "))
  28.  
  29.     (while (visit-file (concat base-name part))
  30.     {
  31.       (deshar)(save-buffer)(free-buffer -1)
  32.       (+= part 1)
  33.     })
  34.     (update)
  35.     (msg (- part 1) " parts to " '"' base-name '"')
  36.   }
  37. )
  38.