all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Count characters in emacs?
@ 2003-02-25 19:48 Big Slim
  2003-02-25 19:55 ` Eli Zaretskii
  2003-02-25 19:57 ` Aaron Son
  0 siblings, 2 replies; 9+ messages in thread
From: Big Slim @ 2003-02-25 19:48 UTC (permalink / raw)


Anyone know if it's possible to count the number of characters in a
file with emacs? I'm trying to rely less on Word, but that's one
feature I can't seem to find in emacs. Alternately, a shell command
would be nice.

TIA--Big Slim

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

* Re: Count characters in emacs?
  2003-02-25 19:48 Count characters in emacs? Big Slim
@ 2003-02-25 19:55 ` Eli Zaretskii
  2003-02-26 11:09   ` Francesco Scaglioni
  2003-02-25 19:57 ` Aaron Son
  1 sibling, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2003-02-25 19:55 UTC (permalink / raw)


> Date: Tue, 25 Feb 2003 13:48:39 -0600
> From: Big Slim <skinny@bones.com>
> Newsgroups: gnu.emacs.help
> 
> Anyone know if it's possible to count the number of characters in a
> file with emacs?

"C-x =" will show you this info.

> Alternately, a shell command would be nice.

That would be `wc' (assuiming you have it installed).

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

* Re: Count characters in emacs?
  2003-02-25 19:48 Count characters in emacs? Big Slim
  2003-02-25 19:55 ` Eli Zaretskii
@ 2003-02-25 19:57 ` Aaron Son
  2003-02-25 20:21   ` Big Slim
  1 sibling, 1 reply; 9+ messages in thread
From: Aaron Son @ 2003-02-25 19:57 UTC (permalink / raw)


Big Slim <skinny@bones.com> writes:

> Anyone know if it's possible to count the number of characters in a
> file with emacs? I'm trying to rely less on Word, but that's one
> feature I can't seem to find in emacs. Alternately, a shell command
> would be nice.

Answer from the nice people in #emacs on irc.freenode.net:

If you're not using narrowing, it looks like C-= will do it.

If you are using narrowing, use C-x h to mark the whole buffer, and
then M-= to count the number of lines and characters in the region.
Note, this will destroy your point position, save it if ya need it.

--Aaron

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

* Re: Count characters in emacs?
  2003-02-25 19:57 ` Aaron Son
@ 2003-02-25 20:21   ` Big Slim
  2003-02-25 21:18     ` Stefan Monnier
  2003-02-26 18:15     ` Pascal Bourguignon
  0 siblings, 2 replies; 9+ messages in thread
From: Big Slim @ 2003-02-25 20:21 UTC (permalink / raw)


In article <uadgk3zhj.fsf@uiuc.edu.invalid>, Aaron Son
<aaronson@uiuc.edu.invalid> wrote:

> Big Slim <skinny@bones.com> writes:
> 
> > Anyone know if it's possible to count the number of characters in a
> > file with emacs? I'm trying to rely less on Word, but that's one
> > feature I can't seem to find in emacs. Alternately, a shell command
> > would be nice.
> 
> Answer from the nice people in #emacs on irc.freenode.net:
> 
> If you're not using narrowing, it looks like C-= will do it.
> 
> If you are using narrowing, use C-x h to mark the whole buffer, and
> then M-= to count the number of lines and characters in the region.
> Note, this will destroy your point position, save it if ya need it.

Wow! Me likey! Wonder why I couldn't find that in my O'Reilly book?
I'll have to look again...

Thanks--Big Slim

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

* Re: Count characters in emacs?
  2003-02-25 20:21   ` Big Slim
@ 2003-02-25 21:18     ` Stefan Monnier
  2003-02-25 23:58       ` Big Slim
  2003-02-26 18:15     ` Pascal Bourguignon
  1 sibling, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2003-02-25 21:18 UTC (permalink / raw)


>>>>> "Big" == Big Slim <skinny@bones.com> writes:
> Wow! Me likey! Wonder why I couldn't find that in my O'Reilly book?

It's a sign from The Almighty(tm) that you should read the manual instead.

	C-h i m emacs RET


-- Stefan

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

* Re: Count characters in emacs?
  2003-02-25 21:18     ` Stefan Monnier
@ 2003-02-25 23:58       ` Big Slim
  2003-02-26  9:16         ` Kai Großjohann
  0 siblings, 1 reply; 9+ messages in thread
From: Big Slim @ 2003-02-25 23:58 UTC (permalink / raw)


In article <5lfzqcoy90.fsf@rum.cs.yale.edu>, Stefan Monnier
<monnier+gnu.emacs.help/news/@flint.cs.yale.edu> wrote:

> >>>>> "Big" == Big Slim <skinny@bones.com> writes:
> > Wow! Me likey! Wonder why I couldn't find that in my O'Reilly book?
> 
> It's a sign from The Almighty(tm) that you should read the manual instead.
> 
>  C-h i m emacs RET

Hilarious, but I can't find it there, either.

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

* Re: Count characters in emacs?
  2003-02-25 23:58       ` Big Slim
@ 2003-02-26  9:16         ` Kai Großjohann
  0 siblings, 0 replies; 9+ messages in thread
From: Kai Großjohann @ 2003-02-26  9:16 UTC (permalink / raw)


Big Slim <skinny@bones.com> writes:

> In article <5lfzqcoy90.fsf@rum.cs.yale.edu>, Stefan Monnier
> <monnier+gnu.emacs.help/news/@flint.cs.yale.edu> wrote:
>
>> >>>>> "Big" == Big Slim <skinny@bones.com> writes:
>> > Wow! Me likey! Wonder why I couldn't find that in my O'Reilly book?
>> 
>> It's a sign from The Almighty(tm) that you should read the manual instead.
>> 
>>  C-h i m emacs RET
>
> Hilarious, but I can't find it there, either.

What did you want to find?  What did you search for to find it?
Maybe the manual can be improved to make it easier to find things.

I also recomment the `i' key for searching the index.
-- 
A preposition is not a good thing to end a sentence with.

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

* Re: Count characters in emacs?
  2003-02-25 19:55 ` Eli Zaretskii
@ 2003-02-26 11:09   ` Francesco Scaglioni
  0 siblings, 0 replies; 9+ messages in thread
From: Francesco Scaglioni @ 2003-02-26 11:09 UTC (permalink / raw)


I have this is what I call misc.el which gets loaded at run time --
relies on the aforementioned WC but works fine with M-x wc return.  I
did not write this myself but cannnot remember where I cribbed it from
( all credit goes to whoever it was ).

Cheers

F

;; WORD COUNT
(defun wc ()
"Count the words in the current buffer, show the result in the
 minibuffer"
 (interactive)
 (save-excursion 
 (save-restriction
 (widen)
 (goto-char (point-min))
 (let ((count 0))
 (while (forward-word 1)
  (setq count(1+ count)))
(message "There are %d words in the buffer" count)))))

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

* Re: Count characters in emacs?
  2003-02-25 20:21   ` Big Slim
  2003-02-25 21:18     ` Stefan Monnier
@ 2003-02-26 18:15     ` Pascal Bourguignon
  1 sibling, 0 replies; 9+ messages in thread
From: Pascal Bourguignon @ 2003-02-26 18:15 UTC (permalink / raw)


Big Slim <skinny@bones.com> writes:
> > If you're not using narrowing, it looks like C-= will do it.
> > 
> > If you are using narrowing, use C-x h to mark the whole buffer, and
> > then M-= to count the number of lines and characters in the region.
> > Note, this will destroy your point position, save it if ya need it.
> 
> Wow! Me likey! Wonder why I couldn't find that in my O'Reilly book?
> I'll have to look again...


Also better than a book:

     M-x apropos RET count RET


-- 
__Pascal_Bourguignon__                   http://www.informatimago.com/
----------------------------------------------------------------------
There is a fault in reality. Do not adjust your minds. -- Salman Rushdie

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

end of thread, other threads:[~2003-02-26 18:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-25 19:48 Count characters in emacs? Big Slim
2003-02-25 19:55 ` Eli Zaretskii
2003-02-26 11:09   ` Francesco Scaglioni
2003-02-25 19:57 ` Aaron Son
2003-02-25 20:21   ` Big Slim
2003-02-25 21:18     ` Stefan Monnier
2003-02-25 23:58       ` Big Slim
2003-02-26  9:16         ` Kai Großjohann
2003-02-26 18:15     ` Pascal Bourguignon

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.