home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / elisp / packages / rpc-hm-1.0 / gobble-whitespace.el < prev    next >
Encoding:
Text File  |  1992-05-07  |  736 b   |  26 lines

  1. ;Author: Eyvind Ness (eyvind) 
  2. ;Date:   Thursday, March 26 1992 19:35 GMT
  3. ;File:   /usr/local/gnu/emacs/elisp/site-extensions/gobble-whitespace.el
  4.  
  5. (provide 'gobble-whitespace)
  6.  
  7. (defun gw-skip-blank-lines-and-comments ()
  8.   (interactive)
  9.   (let ((omd (match-data)))
  10.     (unwind-protect
  11.     (let ((current-line-string
  12.            (buffer-substring 
  13.         (point)
  14.         (save-excursion (end-of-line) (point)))))
  15.       (while (and (not (eobp))
  16.               (string-match 
  17.                "\\(^[ \t]*$\\)\\|\\(^[ \t]*[;]+.*$\\)"
  18.                current-line-string))
  19.         (forward-line 1)
  20.         (setq current-line-string
  21.           (buffer-substring 
  22.            (point)
  23.            (save-excursion (end-of-line) (point)))))
  24.       (skip-chars-forward " \t" (point-max)))
  25.       (store-match-data omd))))
  26.