unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Word count in Emacs
@ 2012-09-14 17:55 B. T. Raven
  2012-09-14 18:14 ` Jambunathan K
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: B. T. Raven @ 2012-09-14 17:55 UTC (permalink / raw)
  To: help-gnu-emacs

Can anyone give me a clue why the following doesn't print a number in
the mini-buffer or to the *Messages* buffer?:

(defun count-words (start end) ;; alias wce
    "Print number of words in the region."
    (interactive "r")
    (save-excursion
      (save-restriction
        (narrow-to-region start end)
        (goto-char (point-min))
        (count-matches "\\sw+"))))

an alias is assigned so that I can invoke with

M-x wce (word count emacs)

Thanks,

Ed


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-09-15 23:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-14 17:55 Word count in Emacs B. T. Raven
2012-09-14 18:14 ` Jambunathan K
2012-09-14 19:28 ` Alp Aker
     [not found] ` <mailman.8893.1347650994.855.help-gnu-emacs@gnu.org>
2012-09-15 23:11   ` B. T. Raven
     [not found] ` <mailman.8880.1347646427.855.help-gnu-emacs@gnu.org>
2012-09-15 23:23   ` B. T. Raven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).