From: steve-humphreys@gmx.com
To: Help Gnu Emacs <help-gnu-emacs@gnu.org>
Subject: upcase-initials-region on show-duvall-jefferies-etal-1993
Date: Fri, 7 May 2021 04:26:49 +0200 [thread overview]
Message-ID: <trinity-7d777b58-715c-48ca-97a5-59e19f9d8400-1620354409197@3c-app-mailcom-bs12> (raw)
I have strings in a file of the form "Show-Duvall-Jefferies-etAl-1993".
Would like to switch between the following three versions
"Show-Duvall-Jefferies-Etal-1993" ;
"SHOW-DUVALL-JEFFERIES-ETAL-1993" ; can be done with upcase-region
"show-duvall-jefferies-etal-1993" ; can be done with downcase-region
"Show-Duvall-Jefferies-Etal-1993" ; cannot be done with upcase-initials-region
I am getting the bounds ($ma $mb) for the string like this
(defun alnum-dash-bounds ()
"Gets bounds of a subword unit defined by [:alnum:] and dash."
(let ( ($bounds nil) $ma $mb )
(skip-chars-backward "[:alnum:]-") ; same as ""[a-zA-Z0-9]-"
(setq $ma (point))
(skip-chars-forward "[:alnum:]-")
(setq $mb (point))
(cons $ma $mb) ))
next reply other threads:[~2021-05-07 2:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-07 2:26 steve-humphreys [this message]
2021-05-07 2:32 ` upcase-initials-region on show-duvall-jefferies-etal-1993 Stefan Monnier via Users list for the GNU Emacs text editor
2021-05-07 5:04 ` steve-humphreys
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=trinity-7d777b58-715c-48ca-97a5-59e19f9d8400-1620354409197@3c-app-mailcom-bs12 \
--to=steve-humphreys@gmx.com \
--cc=help-gnu-emacs@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).