From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: counting chars in buffer Date: Tue, 13 Jun 2017 02:16:03 +0700 Message-ID: References: <86wp8h6nrg.fsf@zoho.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1497295043 29622 195.159.176.226 (12 Jun 2017 19:17:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 12 Jun 2017 19:17:23 +0000 (UTC) To: "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 12 21:17:13 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dKUpt-0007CH-2C for geh-help-gnu-emacs@m.gmane.org; Mon, 12 Jun 2017 21:17:13 +0200 Original-Received: from localhost ([::1]:39679 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKUpy-0000iV-3d for geh-help-gnu-emacs@m.gmane.org; Mon, 12 Jun 2017 15:17:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47262) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKUpE-0000fF-3o for help-gnu-emacs@gnu.org; Mon, 12 Jun 2017 15:16:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dKUp9-0007yq-LD for help-gnu-emacs@gnu.org; Mon, 12 Jun 2017 15:16:32 -0400 Original-Received: from mail-wr0-x22b.google.com ([2a00:1450:400c:c0c::22b]:33180) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dKUp9-0007yc-DG for help-gnu-emacs@gnu.org; Mon, 12 Jun 2017 15:16:27 -0400 Original-Received: by mail-wr0-x22b.google.com with SMTP id v104so107412136wrb.0 for ; Mon, 12 Jun 2017 12:16:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=6/3hkZ01Wozz5XpbwpvsX4y2VQkZIrxY1sfj4WsJuDs=; b=a/Whu5ab3iPN3HzTIVeQahfg5fOi432kgiIYpaSrLuLgYVOTW34woB8N+OmXyx4H9s NL9hbY8heFNKQ/dsmc3V+5km+5uch/+1YjRi5bvfEteF8y0dvbS6oeQD1y1wtplsKbUJ OcWuyj/5mVc/bjfSmiLQAFfee3tCZgGBt0laeVbSIF7Wal9CYqL5WIMo4dj4T0YQHBMz A9eX8R3iAK39XzIeo9mckmQts57MZYqJlNtWwZQVCAJ+WCIltis0azrJMIlrU3+VO1QW +Ubjj3AXVG3xA3tP+QcZsAyZIlnn9Dea1FHVAdkmtGB4m1fZS9+7tRDWg0nmvXaQS94U Hgyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=6/3hkZ01Wozz5XpbwpvsX4y2VQkZIrxY1sfj4WsJuDs=; b=nPzmkHo+MvTYRxIZs6PJQxsKi9MVpLEwYR1q8wZJOkiNAAp7nKcxS3jvsfCwBtAjpn jojeMZJsGVWMy4Dg05wfKhGCOnrocT8dJcAa40zAJXMOUdELRtPN2sanXPUWUDPekezB YIl+4rQsNbxxQmmG4POXXUwgw7zVmnOP2jagvPNdJAHsiISP76I62cLi5fXN0j9dZosr HCyRii9FU5A/IgTHIlAMqQ6homNRISMtBaVossArDnsax1RSsBIciXD3pAPN4j+TiRye fVuhLXHvaA8W5X/25CBg78rwqP1y52BnjdQnTUE3shcFVJg418CjMa2qlfyiJrNKRIQr N9ow== X-Gm-Message-State: AKS2vOxu4ds39VjKifgSL8HQ3VxE/wiNXvvqXfmNoneaRQaTHCGSP4VJ Tf6/Tv5EU8j4urM0Xj0ulPwOMthzADaG X-Received: by 10.223.163.89 with SMTP id d25mr323003wrb.98.1497294983499; Mon, 12 Jun 2017 12:16:23 -0700 (PDT) Original-Received: by 10.223.164.93 with HTTP; Mon, 12 Jun 2017 12:16:03 -0700 (PDT) In-Reply-To: <86wp8h6nrg.fsf@zoho.com> X-Google-Sender-Auth: BQF5cAVN2Fz-_32EDWCDY1AYwlo X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::22b X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:113433 Archived-At: On Tue, Jun 13, 2017 at 1:53 AM, Emanuel Berg wrote: > How would one do that? Interactively, M-= (count-words-region) displays region or buffer size in characters as part of its output. Programmatically, (buffer-size) is documented to return a character count (as opposed to an octet count). Also, any positions are specified in characters so you can just subtract them.