[Top][All Lists]

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

suggestion: function: buffer-bytes

From: T. V. Raman
Subject: suggestion: function: buffer-bytes
Date: Sat, 30 Jun 2007 17:18:38 -0700

Emacs built-in buffer-size returns the number of characters ---
in some situations one needs the count of bytes. 
Here is a small function that does this --- perhaps it could be
ncluded in subr.el?

(defsubst buffer-bytes (&optional buffer)
  "Return number of bytes in a buffer."
    (and buffer (set-buffer buffer))
    (1- (position-bytes (point-max)))))

Best Regards,

Email:  address@hidden
WWW:    http://emacspeak.sf.net/raman/
AIM:    emacspeak       GTalk: address@hidden
PGP:    http://emacspeak.sf.net/raman/raman-almaden.asc
Google: tv+raman 
IRC:    irc://irc.freenode.net/#emacs

reply via email to

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