-(defun ff/count-char ()
- "Prints the number of characters between the first previous \"--\"
-and the firt next \"--\"."
- (interactive)
- (let ((from (save-excursion (re-search-backward "^--$\\|BEGIN_COUNT" nil t)))
- (to (save-excursion (re-search-forward "^--$\\|END_COUNT" nil t))))
- (if (and to from) (message "%d character(s)" (- to from 6))
- (error "Can not find the -- delimiters"))))
-
-(defun ff/count-words ()
- "Print number of words between the first previous \"--\" and the
-firt next \"--\"."
- (interactive)
- (let ((from (save-excursion (re-search-backward "^--$" nil t)))
- (to (save-excursion (re-search-forward "^--$" nil t))))
- (if (and to from)
- (save-excursion
- (goto-char from)
- (let ((count 0))
- (while (< (point) to)
- (re-search-forward "\\w+\\W+")
- (setq count (1+ count)))
- (message "%d word(s)" count)))
- (error "Can not find the -- delimiters"))))
-