GNU bug report logs - #50726
26.3; Let `count-words(-region)' count only words entirely within the region

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Drew Adams <drew.adams@HIDDEN>; dated Tue, 21 Sep 2021 22:52:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 50726 <at> debbugs.gnu.org:


Received: (at 50726) by debbugs.gnu.org; 29 Sep 2021 11:33:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 29 07:33:19 2021
Received: from localhost ([127.0.0.1]:47909 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mVXpu-000181-VW
	for submit <at> debbugs.gnu.org; Wed, 29 Sep 2021 07:33:19 -0400
Received: from mail-pg1-f177.google.com ([209.85.215.177]:44946)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1mVXps-00017Y-M9
 for 50726 <at> debbugs.gnu.org; Wed, 29 Sep 2021 07:33:17 -0400
Received: by mail-pg1-f177.google.com with SMTP id s11so2355861pgr.11
 for <50726 <at> debbugs.gnu.org>; Wed, 29 Sep 2021 04:33:16 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:in-reply-to:references:user-agent
 :mime-version:date:message-id:subject:to:cc;
 bh=2/f8UrfzKk8ga2EQSqGXZpWc3UPhFGGJXObZbKsQTNo=;
 b=G1BRFU7O1stfYeECHua71SsFXwbmQsSgMlgumxYhbA9nAOGUChsl9aq5Xjz00eiPIh
 VGclhI+LKXGz8xBHv2PdcCDcL5N2a4BLGnVDQDagtKzMZqXvUjzhQB9oXUXX7/nfHz3X
 PmPH3IRDj/cQDPv+86G2Ewpxy/u/JKA88o6ZuzWOVHo93f+AIyBFIqfh92PLJNTpSOYb
 Qpug+dFVopbcbksZJPQhJTVo2w/XtGbFOOekQbuEd7+ZdLe/PdRFnyO7C99w5bWXdKQD
 bWEiVcOOq0YKgp5/bA+XYYQGm9Srf7sn0a95XTMg7Fcet0k4BHs5cfDDTbm8k3AhSCFh
 Ie0w==
X-Gm-Message-State: AOAM532pqLhLJc8/s0Hv3dTYLEZYHqnQMpoBMZZZenUMkvmSNezTNSbM
 bFt/wnUYicBB/jDh8WRQqKLGdgMMkaZDutw66Bo=
X-Google-Smtp-Source: ABdhPJxw0TqdJP0Ay7Q1RSpcaWuOjGgD+1M3qHeUPtVMBq2SIPPEbNO82OYjoarRu+T8FlqFNFjAowzAR4Y/oRpvsNo=
X-Received: by 2002:a63:4717:: with SMTP id u23mr9041465pga.359.1632915190974; 
 Wed, 29 Sep 2021 04:33:10 -0700 (PDT)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Wed, 29 Sep 2021 04:33:10 -0700
From: Stefan Kangas <stefan@HIDDEN>
In-Reply-To: <SJ0PR10MB5488D017C2A2EE626814F222F3A19@HIDDEN>
 (Drew Adams's message of "Tue, 21 Sep 2021 22:50:56 +0000")
References: <SJ0PR10MB5488D017C2A2EE626814F222F3A19@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Date: Wed, 29 Sep 2021 04:33:10 -0700
Message-ID: <CADwFkmm0_G3HW3rKezbvtFqAyH46FtL9ki52XU18S+ZjXHDRXQ@HIDDEN>
Subject: Re: bug#50726: 26.3; Let `count-words(-region)' count only words
 entirely within the region
To: Drew Adams <drew.adams@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 50726
Cc: 50726 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

Drew Adams <drew.adams@HIDDEN> writes:

> Enhancement request.
>
> A word that straddles the beginning or end of the region is counted as a
> word in the region.  It would be good to be able to have such functions
> not count such partial words.
> ___
>
> Here's an example of a command that counts the words in a rectangular
> region.  By default it excludes words that straddle the row boundaries,
> but a prefix arg counts such partial words also.
>
> https://emacs.stackexchange.com/a/68611/105

Copying in the code below.  I have no comment, besides to say that a
more strict `count-words' could perhaps be named `count-words-strict'.

(defun count-words-rectangle (start end &optional allow-partial-p msgp)
  "Count words in the rectangle from START to END.
This is similar to `count-words', but for a rectangular region.

Also:

* By default, a word that straddles the beginning or end of a
  rectangle row is not counted.  That is, this counts only words that
  are entirely within the rectangle.
* A prefix arg means count also such partial words at row boundaries.

If called interactively, START and END are the bounds of the start and
end of the active region.  Print a message reporting the number of
rows (lines), columns (characters per row), words, and characters.

If called from Lisp, return the number of words in the rectangle
between START and END, without printing any message."
  (interactive "r\nP\np")
  (let ((bounds  (extract-rectangle-bounds start end))
        (words   0)
        (chars   0))
    (dolist (beg+end  bounds)
      (setq words  (+ words (count-words (car beg+end) (cdr beg+end)))))
    (let (beg end)
      (dolist (beg+end  bounds)
        (setq beg  (car beg+end)
              end  (cdr beg+end))
        (unless allow-partial-p
          (when (and (char-after (1- beg))  (equal '(2) (syntax-after (1- beg)))
                     (char-after beg)       (equal '(2) (syntax-after beg)))
            (setq words  (1- words)))
          (when (and (char-after (1- end))  (equal '(2) (syntax-after (1- end)))
                     (char-after end)       (equal '(2) (syntax-after     end)))
            (setq words  (1- words))))))
    (when msgp
      (dolist
          (beg+end  bounds)
        (setq chars  (+ chars (- (cdr beg+end) (car beg+end)))))
      (let ((rows  (count-lines start end))
            (cols  (let ((rpc  (save-excursion
                                 (rectangle--pos-cols
(region-beginning) (region-end)))))
                     (abs (- (car rpc) (cdr rpc))))))
        (message "Rectangle has %d row%s, %d colum%s, %d word%s, and %d char%s."
                 rows  (if (= rows 1)  "" "s")
                 cols  (if (= cols 1)  "" "s")
                 words (if (= words 1) "" "s")
                 chars (if (= chars 1) "" "s"))))
    words))




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50726; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 21 Sep 2021 22:51:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 21 18:51:10 2021
Received: from localhost ([127.0.0.1]:48216 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mSobW-0001wm-Eh
	for submit <at> debbugs.gnu.org; Tue, 21 Sep 2021 18:51:10 -0400
Received: from lists.gnu.org ([209.51.188.17]:52790)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1mSobT-0001we-U3
 for submit <at> debbugs.gnu.org; Tue, 21 Sep 2021 18:51:08 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:42878)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <drew.adams@HIDDEN>)
 id 1mSobT-0008Bx-HJ
 for bug-gnu-emacs@HIDDEN; Tue, 21 Sep 2021 18:51:07 -0400
Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:39640)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <drew.adams@HIDDEN>)
 id 1mSobO-0005aS-GT
 for bug-gnu-emacs@HIDDEN; Tue, 21 Sep 2021 18:51:07 -0400
Received: from pps.filterd (m0246627.ppops.net [127.0.0.1])
 by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 18LLEBAa027974
 for <bug-gnu-emacs@HIDDEN>; Tue, 21 Sep 2021 22:50:59 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com;
 h=from : to : subject :
 date : message-id : content-type : content-transfer-encoding :
 mime-version; s=corp-2021-07-09;
 bh=oqi60CFOSkBlhKhAa41IrGkpsOLkxo8/9f+eR5DOjK0=;
 b=sBBxkKya1kjvVqKDYzsPBk2CnOHluoNYHqQwmrLTWGhlPBhdcY7DIgce/CY2rg69YHGW
 ZaBRTp43uUp2intXv2ciq3+FPMXj6RkghOnRxRDv7MzgWLbPPP3tt0o+5tZUh1TIk7HR
 vkWQpHQih2sCrfYmMhd5keDbvS/ghycBaKSMDw9d7p2qpE3BzBtaMQmVgMSg58YreDe1
 CQGpDeA4tFuBDo0jO7dklfj8tC3+LYwv8K2p+tmvs3odKX3xLbkJpQhctKe+AA/LbTce
 fWukGUr9MNZ6TNz02oZxZ4qhPbMTVHwfgT8nADZn/Dra3ymO7BnUdMnsevk7Q1R75wV3 sQ== 
Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71])
 by mx0b-00069f02.pphosted.com with ESMTP id 3b7q4r8c6b-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK)
 for <bug-gnu-emacs@HIDDEN>; Tue, 21 Sep 2021 22:50:59 +0000
Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1])
 by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 18LMit1v025899
 for <bug-gnu-emacs@HIDDEN>; Tue, 21 Sep 2021 22:50:58 GMT
Received: from nam11-bn8-obe.outbound.protection.outlook.com
 (mail-bn8nam11lp2171.outbound.protection.outlook.com [104.47.58.171])
 by aserp3030.oracle.com with ESMTP id 3b7q5bavew-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK)
 for <bug-gnu-emacs@HIDDEN>; Tue, 21 Sep 2021 22:50:57 +0000
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=eY0djgmiKNxkVKh6sY4OsxbUPI6vhWKxThVEsi/CVffHIckZ/Bf0cjgGK1XI1zosMLkKSzWV8OhI2/cD9gExCWAImq13gUOfpHxj19AyYEK1PYTWe/t8Ocg5JUVg834opKMq5nXlOyj94rQVeecf8HYawxfNf3rfT4ab9AG8zya/IkhGx7rkx/kOyqipp/zMmYeVHiiWXZZIARX73AfHnL9C+pQHU0q+ylhpE3y0h1nKKfXbDG7ZWuJoolPmVfYuA6K9h+5p2p/MQqjkuEUoh8qAnIu0UuJ5w3uJbhcmpmdZ4j2l2I8vfc9x0fOkA1iQ5cBfmNWJMymsDZ2Em2QL1w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; 
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; 
 bh=oqi60CFOSkBlhKhAa41IrGkpsOLkxo8/9f+eR5DOjK0=;
 b=BNmZnLXeeIxrcP5qWbJgyZohXftlOxkSU5W/KvAexbSV8EgpDttndSFRbNyQUqll0+HtF7c4yymPG0wxzxC9vK/pMTJmNch0xCXVMiapqIxdEz5NhgMZ3Eki8cYhdmbgN9nGO8ZNDJHRYGenA2+mSzmcU9evm/rgFGGjY24VALYcrmPre12qlbdMYCf/cPLvn4k9lFwgFcAVMpdfb5mxKc3U3FbxXISvlUIo6tPllao5HOY/BWwlxS4M+kU1kpwh9SWEsU+WEDWonBO0lq0efzCHN6/2DFlD5KKqPr0QhBcQcKSl7uZTMD8uSBhs3FO/JP+jh7nBS/gC2rWXy7cwsA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com;
 dkim=pass header.d=oracle.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=oqi60CFOSkBlhKhAa41IrGkpsOLkxo8/9f+eR5DOjK0=;
 b=L2d/7HiBaVB12IZJcdkmmQhPQ6PRKPc/2XulWGV46XS0HmtrkBP4U+V2pYp27z8BtgduYPiaVwNSx2bta0OTBW+tqp24vF7udU1pDLUCJgqVSH+x0Hx0OQXhew73G6xo0c4SW/HQxg88CRBlaicnLurFYNIQ+AUHZRQG8jremDg=
Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19)
 by BYAPR10MB2917.namprd10.prod.outlook.com (2603:10b6:a03:87::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.18; Tue, 21 Sep
 2021 22:50:56 +0000
Received: from SJ0PR10MB5488.namprd10.prod.outlook.com
 ([fe80::c0bc:7c3a:292f:8a82]) by SJ0PR10MB5488.namprd10.prod.outlook.com
 ([fe80::c0bc:7c3a:292f:8a82%9]) with mapi id 15.20.4523.018; Tue, 21 Sep 2021
 22:50:56 +0000
From: Drew Adams <drew.adams@HIDDEN>
To: "bug-gnu-emacs@HIDDEN" <bug-gnu-emacs@HIDDEN>
Subject: 26.3; Let `count-words(-region)' count only words entirely within the
 region
Thread-Topic: 26.3; Let `count-words(-region)' count only words entirely
 within the region
Thread-Index: AdevOwJg6sdaxjiaSR+woxP3HauAxw==
Date: Tue, 21 Sep 2021 22:50:56 +0000
Message-ID: <SJ0PR10MB5488D017C2A2EE626814F222F3A19@HIDDEN>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
authentication-results: gnu.org; dkim=none (message not signed)
 header.d=none;gnu.org; dmarc=none action=none header.from=oracle.com;
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 2f7760ad-ff32-418c-5cbe-08d97d5245e4
x-ms-traffictypediagnostic: BYAPR10MB2917:
x-microsoft-antispam-prvs: <BYAPR10MB2917AC97EADC649AEFCCC92DF3A19@HIDDEN>
x-ms-oob-tlc-oobclassifiers: OLM:9508;
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: zGi7gLjoXhyUmqzaYG8mYBmJCT2szJL+Pi4+MNR4Gi49nYD7dHkGPT3Iv4QYv8ozQ+dysjDs3o6Gl/QbblI4C1nuc6tGRHg8X0ObKRgE9SUhF7YL5kThKpKFKZ+xYvkErz4F/i6VgHOtei2cOyJdIQY2RQW1P+BHHewcjpSYB3SlLRjf+KI96+h0aD4MwNpeG3eFM301RW5mdFb+Y/vhn92vueq27zWRoME+DR7WrC/c41U6NB2sVN2ImjXru9B1xvliojMAsc6l7fn+TAba/uUzWVEU6zVJfzF930adoL336hdOmRj0TbVBc+wK17AZttryMpjhH0kZX/OdsOvr4iImflq3iYgUM4JfQ5+FESxR6dv/pZnA6GgPAnJ6gUaH1gZQVvPGNx6b2UD/gLic49XVtLgn4KzkaHJ8qvSTvEKuztIOWQoOfRffunJjWCKOjdO9kq2LIlTjXcaqsGgxIq19amkP6WGxnGWGt552KILw3x0xiQ05zV0vwn3S3Et9jTqf/wJyBD2HEdHB2DFCAZfThtstFASe3FfMx3xayyt+oRkgBq6S1i/AHKpC1c9Pr8fbl+B2Ya9KRQp71GG9gyP8DJf8ebNvUgTQWHyHVm/7l+jq33DLefh79r+LWEgHB7abm17Jcj79X4AKvpjzPAmDr47l0B8ljdb2FVrfzv1+xvjBTR5B2J5PJ90Hxcdior1ChI3AeiaQ+iczluAPb6XEwKtnoxoPFvtSEgBF6TY69BTsyjRwpj37jTe0lFYastBGReCJ9MnLway4Uuk5zlI3TT5VfAKKTmf0e22w0KepJW/T3O2BmbtO66ZaBp4I
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
 IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE;
 SFS:(366004)(8676002)(66446008)(8936002)(71200400001)(6506007)(66946007)(55016002)(122000001)(38100700002)(5660300002)(7696005)(52536014)(86362001)(6916009)(26005)(38070700005)(76116006)(66556008)(64756008)(66476007)(2906002)(316002)(966005)(508600001)(45080400002)(33656002)(9686003)(83380400001)(186003)(44832011)(81973001);
 DIR:OUT; SFP:1101; 
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?1pLDrRXKyPGESGIOdNLB1H3bAR9yKtqrGA1tp0jtyCVx5FG0ygmzdJkQOJB1?=
 =?us-ascii?Q?/9SmWyjm8eHhG96MZo6OCK4qIhs6n0QRwii8Cat6VBESNpFsp87AOAmU8Psc?=
 =?us-ascii?Q?EeHaOJ8mcKjWLFNQawAv5gVe7ccM8noU0/IMGSexX95wT660Yai4cU/OTW7A?=
 =?us-ascii?Q?zI7upV/RbHOnYJGXqvPN4f96z65SW46T9IFjEkgt2pj0ziBLeUMevgxvjyMo?=
 =?us-ascii?Q?hzRtSPwNNQ3xVodS8vlhxtWe9IynV9QFlCv2MAAujxQhvpArCYD4lrayGlBP?=
 =?us-ascii?Q?bRjA8rAwNjAqfzWI+I1DxtkrNmFtMW74x2N26+ZeS2Cj6x2p5EVEYVcSaNsu?=
 =?us-ascii?Q?t2fKgu26mZyENudBnB4tMtGJiCydOJSnJbslRNoAuVXW1nsSMDbBRz+wogqa?=
 =?us-ascii?Q?Vj9KrldXZZSZNqbd0NL5ARJl6D+o0Cmcq8KGsoAqRdz5qmfUgEbLW+fKC7fI?=
 =?us-ascii?Q?QQO0kxCFDaxgR2y+f1bLMujyIG8e3742C/Rau5qdFhUq9lzVSpydVqBcFaGp?=
 =?us-ascii?Q?s7q+j14ZEswI+qqXeMgx76kicAAhLu3Lsz5+Gxmwooxqn4G7FCJKQFoSGj1i?=
 =?us-ascii?Q?olbm0xlw2826FviBTbLakoGFUy7HVx3LfN8Xv6G0VkNNgtDDRmY4rSoQcFct?=
 =?us-ascii?Q?fs8TGDpz6G1ZUv2FKCbGwxy5u5l4Dm4Ds0RBX+ht+qnj+UYd2cqwbg5ToWbi?=
 =?us-ascii?Q?z3M+o7cXOextyRa68CzqFaxZIsUv7EhsZEINz3RuRMZtK5v+sc6yzolzK3U0?=
 =?us-ascii?Q?63RlsmQs+QpcnNLuXkZAkRm9eA7glLc7gQt+zWf52yehBe3tvXM/UTZSA02V?=
 =?us-ascii?Q?7voD4aqg3HJULn8ljXo14/ry/Y8pScld64EULC9Rez1ooHS7Mt8PSzrxL4xU?=
 =?us-ascii?Q?i0drPCOouEATn+WE7xDuXzCiPHknqQEMJX/l4SF+eJ6Vhvlwp4Vm0xCFijwX?=
 =?us-ascii?Q?bFSEDH6TBTfDfASZk1uOnrWwLdjtFOdMFqXTeff3+vmhrmqO2Efb6j8/xDcs?=
 =?us-ascii?Q?DiC29NQtJNOoKlhFyX+xUnS4enRffFP6Rq9aSQqHDM2t0u8nV5cnXOjTSsu3?=
 =?us-ascii?Q?gCqOJ74KNdyjzdwYz0r2euHQS2uH3sKe91aWvbvbgqoEB2vhF0HxWkkmcAJs?=
 =?us-ascii?Q?7SVuK10aNYCT2FtjzRY/G/xYhS5xXf7h0wcoBxFA4mjsupYj38h328nTLAjK?=
 =?us-ascii?Q?24TFKolcuSDiW/WvXVOfFt4F/o823llHTNjY8LGfSJR3Xq73f+R2dTGFApZ7?=
 =?us-ascii?Q?6cQofmQB0abPqNWEWxV1xzdN0/hFpYgnZQN6XITK7msJStOboYJnEkeBHee1?=
 =?us-ascii?Q?Gx1qdhaMFmDppN2nYGbcvzNo?=
x-ms-exchange-transport-forked: True
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: oracle.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 2f7760ad-ff32-418c-5cbe-08d97d5245e4
X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Sep 2021 22:50:56.1626 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: LYrNr/xvQR8nPn76rY8F7b3ZugVDH36H5qYot2bYgWd8SBsN9x90rHZxzm6oYGCIRDXcy8/Cp6ePik8MEcrQfg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB2917
X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10114
 signatures=668682
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0
 phishscore=0
 malwarescore=0 mlxlogscore=999 suspectscore=0 bulkscore=0 mlxscore=0
 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2109200000 definitions=main-2109210136
X-Proofpoint-GUID: hSZGZ2Oe7txmCtcdy_YRBTZ0Qz4bRlYC
X-Proofpoint-ORIG-GUID: hSZGZ2Oe7txmCtcdy_YRBTZ0Qz4bRlYC
Received-SPF: pass client-ip=205.220.165.32;
 envelope-from=drew.adams@HIDDEN; helo=mx0a-00069f02.pphosted.com
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Enhancement request.

A word that straddles the beginning or end of the region is counted as a
word in the region.  It would be good to be able to have such functions
not count such partial words.
___

Here's an example of a command that counts the words in a rectangular
region.  By default it excludes words that straddle the row boundaries,
but a prefix arg counts such partial words also.

https://emacs.stackexchange.com/a/68611/105
___

Admittedly, this difference is not so important for a non-rectangular
region, as it has only two boundaries, and a user can see interactively
whether the text at the beginning or end forms a real word.  But when
called from Lisp, if you want to exclude such partial words you need to
write some code to adjust the count.

In GNU Emacs 26.3 (build 1, x86_64-w64-mingw32)
 of 2019-08-29
Repository revision: 96dd0196c28bc36779584e47fffcca433c9309cd
Windowing system distributor `Microsoft Corp.', version 10.0.19042
Configured using:
 `configure --without-dbus --host=3Dx86_64-w64-mingw32
 --without-compress-install 'CFLAGS=3D-O2 -static -g3''





Acknowledgement sent to Drew Adams <drew.adams@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#50726; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 29 Sep 2021 11:45:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.