unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* upcase-initials-region on show-duvall-jefferies-etal-1993
@ 2021-05-07  2:26 steve-humphreys
  2021-05-07  2:32 ` Stefan Monnier via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 3+ messages in thread
From: steve-humphreys @ 2021-05-07  2:26 UTC (permalink / raw)
  To: Help Gnu Emacs

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) ))




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: upcase-initials-region on show-duvall-jefferies-etal-1993
  2021-05-07  2:26 upcase-initials-region on show-duvall-jefferies-etal-1993 steve-humphreys
@ 2021-05-07  2:32 ` Stefan Monnier via Users list for the GNU Emacs text editor
  2021-05-07  5:04   ` steve-humphreys
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2021-05-07  2:32 UTC (permalink / raw)
  To: help-gnu-emacs

> "Show-Duvall-Jefferies-Etal-1993"  ; can be done with downcase-region
> "Show-Duvall-Jefferies-Etal-1993"  ; cannot be done with upcase-initials-region

I just tried this in your message and `upcase-initials-region` gave me
exactly what you seem to want, so you're going to need to give more
detail about what you mean by "cannot be done with".


        Stefan




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: upcase-initials-region on show-duvall-jefferies-etal-1993
  2021-05-07  2:32 ` Stefan Monnier via Users list for the GNU Emacs text editor
@ 2021-05-07  5:04   ` steve-humphreys
  0 siblings, 0 replies; 3+ messages in thread
From: steve-humphreys @ 2021-05-07  5:04 UTC (permalink / raw)
  To: monnier; +Cc: help-gnu-emacs

Have just figured there was a problem with my configuration and one of the init files
was not being loaded properly.

Many thanks




> Sent: Friday, May 07, 2021 at 2:32 PM
> From: "Stefan Monnier via Users list for the GNU Emacs text editor" <help-gnu-emacs@gnu.org>
> To: help-gnu-emacs@gnu.org
> Subject: Re: upcase-initials-region on show-duvall-jefferies-etal-1993
>
> > "Show-Duvall-Jefferies-Etal-1993"  ; can be done with downcase-region
> > "Show-Duvall-Jefferies-Etal-1993"  ; cannot be done with upcase-initials-region
>
> I just tried this in your message and `upcase-initials-region` gave me
> exactly what you seem to want, so you're going to need to give more
> detail about what you mean by "cannot be done with".
>
>
>         Stefan
>
>
>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-07  5:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-07  2:26 upcase-initials-region on show-duvall-jefferies-etal-1993 steve-humphreys
2021-05-07  2:32 ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-05-07  5:04   ` steve-humphreys

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).