help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to interactive to emacs


From: David Kastrup
Subject: Re: how to interactive to emacs
Date: Sun, 19 Mar 2006 13:34:48 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

"hallen" <longhrs@gmail.com> writes:

> I am get a function to count the words in a buffer
> -----------------count.el
> (defun count-word-buffer()
>   "couont the number of words in the current buffer;
>  priny a message in the minibuffer with the result"
>   (interactive "p")
>   (save-excursion
>    (let ((count 0))
>      (goto-char (point-min))
>      (while (< (point) (point-max))
>        (forward-word 1)
>        (setq count(1+ count)))
>      (message "This buffer total contains %d words" count)))
> ------------------
> i  can use in the emacs-lisp mode .so how can i interactive it to emacs
> so that i can use the count-word-buffer function for all the emacs
> buffer.

Your "interactive" form is incompatible with the actual argument list
of count-word-buffer.  It arranges for count-word-buffer to be called
with one argument.  Remove the "p" from the form if you don't want to
actually use a potential prefix argument.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum


reply via email to

[Prev in Thread] Current Thread [Next in Thread]