From: Jambunathan K <kjambunathan@gmail.com>
To: "B. T. Raven" <btraven@nihilo.net>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Word count in Emacs
Date: Fri, 14 Sep 2012 23:44:38 +0530 [thread overview]
Message-ID: <87zk4szd2p.fsf@gmail.com> (raw)
In-Reply-To: <k2vr4c01o2b@news6.newsguy.com> (B. T. Raven's message of "Fri, 14 Sep 2012 12:55:44 -0500")
M-x count- TAB
or
M-= (does exactly what you are trying to do here, I suppose)
"B. T. Raven" <btraven@nihilo.net> writes:
> 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
>
--
next prev parent reply other threads:[~2012-09-14 18:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-14 17:55 Word count in Emacs B. T. Raven
2012-09-14 18:14 ` Jambunathan K [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zk4szd2p.fsf@gmail.com \
--to=kjambunathan@gmail.com \
--cc=btraven@nihilo.net \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.