Advertisement
Guest User

Untitled

a guest
Oct 29th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.30 KB | None | 0 0
  1. (defun count-blank-lines (&optional arg)
  2.   (interactive "p")
  3.   (let ((count 0)
  4.     (reg "^$")
  5.     (end (point-max)))
  6.     (while (and (null (= (point) end))
  7.         (re-search-forward reg end t))
  8.       (cl-incf count)
  9.       (forward-line))
  10.     (if arg
  11.     (message "%d blank lines found" count)
  12.       count)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement