From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Decebal Newsgroups: gmane.emacs.help Subject: Why does the minibuffer get updated Date: Thu, 15 Jan 2009 08:43:42 -0800 (PST) Organization: http://groups.google.com Message-ID: <726d8899-cdb6-45a8-a30d-8ce27270c7ba@f40g2000pri.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1232041373 1044 80.91.229.12 (15 Jan 2009 17:42:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Jan 2009 17:42:53 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 15 18:44:05 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LNWGB-0002S3-St for geh-help-gnu-emacs@m.gmane.org; Thu, 15 Jan 2009 18:44:04 +0100 Original-Received: from localhost ([127.0.0.1]:52032 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LNWEv-0007Ge-7e for geh-help-gnu-emacs@m.gmane.org; Thu, 15 Jan 2009 12:42:45 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!f40g2000pri.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 35 Original-NNTP-Posting-Host: 85.158.139.99 Original-X-Trace: posting.google.com 1232037822 26131 127.0.0.1 (15 Jan 2009 16:43:42 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 15 Jan 2009 16:43:42 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: f40g2000pri.googlegroups.com; posting-host=85.158.139.99; posting-account=K-cdeAoAAAD_0d505kUtHXJaT5LFIu-3 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5,gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 proxy-26:8080 (squid/2.5.STABLE8), 1.0 netcache-2 (NetCache NetApp/6.0.5), 1.0 netcache-2 (NetCache NetApp/6.0.5), 1.1 cache-5:80 Original-Xref: news.stanford.edu gnu.emacs.help:166039 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:61362 Archived-At: I like to have a wordcount displayed. I tried it with the following: (defun buffer-count-words() (interactive) (let ((occurences (how-many "\\w+" (point-min) (point-max)) ) ) (string-match "[0-9]*" occurences) (match-string 0 occurences) ) ) (defvar buffer-count-words nil "*Number of words in the buffer." ) (defun buffer-update-word-count() (interactive) (setq buffer-count-words (buffer-count-words)) (force-mode-line-update) ) (unless buffer-count-words (run-with-idle-timer 1 t 'buffer-update-word-count) ) (unless (memq 'buffer-count-words global-mode-string) (add-to-list 'global-mode-string " words: " t) (add-to-list 'global-mode-string 'buffer-count-words t) ) This does display the word count, but also keeps putting in the minibuffer ' occurences'. What am I doing wrong?