From: Drew Adams <drew.adams@oracle.com>
To: 50726@debbugs.gnu.org
Subject: bug#50726: 26.3; Let `count-words(-region)' count only words entirely within the region
Date: Tue, 21 Sep 2021 22:50:56 +0000 [thread overview]
Message-ID: <SJ0PR10MB5488D017C2A2EE626814F222F3A19@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
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=x86_64-w64-mingw32
--without-compress-install 'CFLAGS=-O2 -static -g3''
next reply other threads:[~2021-09-21 22:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-21 22:50 Drew Adams [this message]
2021-09-29 11:33 ` bug#50726: 26.3; Let `count-words(-region)' count only words entirely within the region Stefan Kangas
2022-08-26 12:34 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=SJ0PR10MB5488D017C2A2EE626814F222F3A19@SJ0PR10MB5488.namprd10.prod.outlook.com \
--to=drew.adams@oracle.com \
--cc=50726@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.