From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 21 18:51:10 2021 Received: (at submit) by debbugs.gnu.org; 21 Sep 2021 22:51:10 +0000 Received: from localhost ([127.0.0.1]:48216 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSobW-0001wm-Eh for submit@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 ) id 1mSobT-0001we-U3 for submit@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 ) id 1mSobT-0008Bx-HJ for bug-gnu-emacs@gnu.org; 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 ) id 1mSobO-0005aS-GT for bug-gnu-emacs@gnu.org; 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 ; 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 ; 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 ; 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 ; 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 To: "bug-gnu-emacs@gnu.org" 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: 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: 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@oracle.com; 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@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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'' From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 29 07:33:19 2021 Received: (at 50726) by debbugs.gnu.org; 29 Sep 2021 11:33:19 +0000 Received: from localhost ([127.0.0.1]:47909 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVXpu-000181-VW for submit@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 ) id 1mVXps-00017Y-M9 for 50726@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@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 In-Reply-To: (Drew Adams's message of "Tue, 21 Sep 2021 22:50:56 +0000") References: 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: Subject: Re: bug#50726: 26.3; Let `count-words(-region)' count only words entirely within the region To: Drew Adams Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 50726 Cc: 50726@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) Drew Adams 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)) From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 26 08:34:40 2022 Received: (at 50726) by debbugs.gnu.org; 26 Aug 2022 12:34:40 +0000 Received: from localhost ([127.0.0.1]:52601 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRYXn-0005oj-R1 for submit@debbugs.gnu.org; Fri, 26 Aug 2022 08:34:40 -0400 Received: from quimby.gnus.org ([95.216.78.240]:43752) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRYXk-0005oR-Fg for 50726@debbugs.gnu.org; Fri, 26 Aug 2022 08:34:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=66lMlLYfhW/veqcvy116hSuffP92IRCASaC9ecWAKFU=; b=fD8Bxuwxval2JuVSjWjOiUiFVL bw//xTDnjv77vBn/9u4jeTkkmJ3+I0xY40N5rrAMr3tE0as+QT5PZVVc6nNlK/D7ViH29X4ZHUhQv xY2tF7UNpBaHA9xOCw87ySO9lyUymSL/OY9TY8n7/qLHQ2rMbqa9/ZN80pZJyJVHd/80=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oRYXb-0001EO-J6; Fri, 26 Aug 2022 14:34:29 +0200 From: Lars Ingebrigtsen To: Stefan Kangas Subject: Re: bug#50726: 26.3; Let `count-words(-region)' count only words entirely within the region In-Reply-To: (Stefan Kangas's message of "Wed, 29 Sep 2021 04:33:10 -0700") References: X-Now-Playing: Japan's _Quiet Life (1)_: "Quiet Life" Date: Fri, 26 Aug 2022 14:34:27 +0200 Message-ID: <87ilmfb2uk.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Stefan Kangas writes: > I have no comment, besides to say that a more strict `count-words' > could perhaps be named `count-words-strict'. I think adding such a function would be too special-purpose and wouldn't have enough usage to warrant it. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50726 Cc: 50726@debbugs.gnu.org, Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Kangas writes: > I have no comment, besides to say that a more strict `count-words' > could perhaps be named `count-words-strict'. I think adding such a function would be too special-purpose and wouldn't have enough usage to warrant it. So I'm closing this bug report. From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 26 08:34:44 2022 Received: (at control) by debbugs.gnu.org; 26 Aug 2022 12:34:44 +0000 Received: from localhost ([127.0.0.1]:52604 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRYXr-0005oy-70 for submit@debbugs.gnu.org; Fri, 26 Aug 2022 08:34:44 -0400 Received: from quimby.gnus.org ([95.216.78.240]:43768) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRYXn-0005oV-SQ for control@debbugs.gnu.org; Fri, 26 Aug 2022 08:34:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=gw4CkMAsXiRYpt/5YzezWDOfL4h74172kWhSHQRaIl0=; b=ZiyAOxxREOiRZ6zpx8Szt+hFG/ xsuf8Zwf3RnpbWmWlcyz3HcukbIvGYy47sIuzd6iJb9nC/Mv50DmeIkigYG90bpq0/ZJSsdU2XvlF rm6ObjJUE0mBEnrEGDVK2rHNw2mTdmQ0GsyvGKxILae0kBuB2czhao0sJf2Mgn+QCiVc=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oRYXg-0001EV-E2 for control@debbugs.gnu.org; Fri, 26 Aug 2022 14:34:34 +0200 Date: Fri, 26 Aug 2022 14:34:32 +0200 Message-Id: <87h71zb2uf.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #50726 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 50726 wontfix close 50726 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) tags 50726 wontfix close 50726 quit From unknown Sat Jun 21 12:18:20 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 24 Sep 2022 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator