* Capitalize letter after brace
@ 2008-10-15 5:02 Ross A. Laird
2008-10-15 5:28 ` Andrea Vettorello
0 siblings, 1 reply; 4+ messages in thread
From: Ross A. Laird @ 2008-10-15 5:02 UTC (permalink / raw)
To: help-gnu-emacs
This is the type of thing that would take me a day to figure out on my
own (though, probably, I could eventually figure it out), but most
readers of this group can probably throw me a line in a few seconds:
I have some index entries in my tex file that are capitalized
\index{Capitalized} and others that are not \index{not}. I want to make
all entries consistently capitalized. This means a search for the first
character after the opening index brace and a change of its case. What's
the magic formula (please...).
Cheers.
Ross
--
Ross A. Laird, PhD
www.rosslaird.info
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Capitalize letter after brace
2008-10-15 5:02 Capitalize letter after brace Ross A. Laird
@ 2008-10-15 5:28 ` Andrea Vettorello
2008-10-15 5:44 ` Ross A. Laird
0 siblings, 1 reply; 4+ messages in thread
From: Andrea Vettorello @ 2008-10-15 5:28 UTC (permalink / raw)
To: help-gnu-emacs
On Wed, Oct 15, 2008 at 7:02 AM, Ross A. Laird <ross@rosslaird.info> wrote:
> This is the type of thing that would take me a day to figure out on my
> own (though, probably, I could eventually figure it out), but most
> readers of this group can probably throw me a line in a few seconds:
>
> I have some index entries in my tex file that are capitalized
> \index{Capitalized} and others that are not \index{not}. I want to make
> all entries consistently capitalized. This means a search for the first
> character after the opening index brace and a change of its case. What's
> the magic formula (please...).
>
Not tested, probably needs some escaping (I'm not sure if the opening
brace should be escaped), anyway something like:
M-x replace-regexp Enter
Replace regexp: index{\(w\) Enter
with: index{\,(capitalize \1) Enter
The above should capitalize the first word after every "index{" in
your tex file.
--
Andrea
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Capitalize letter after brace
[not found] <mailman.1086.1224046973.25473.help-gnu-emacs@gnu.org>
@ 2008-10-15 5:29 ` Niels Giesen
0 siblings, 0 replies; 4+ messages in thread
From: Niels Giesen @ 2008-10-15 5:29 UTC (permalink / raw)
To: help-gnu-emacs
ross@rosslaird.info (Ross A. Laird) writes:
> This is the type of thing that would take me a day to figure out on my
> own (though, probably, I could eventually figure it out), but most
> readers of this group can probably throw me a line in a few seconds:
>
> I have some index entries in my tex file that are capitalized
> \index{Capitalized} and others that are not \index{not}. I want to make
> all entries consistently capitalized. This means a search for the first
> character after the opening index brace and a change of its case. What's
> the magic formula (please...).
>
C-M-% \({.\) RET \,(upcase \1) RET
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Capitalize letter after brace
2008-10-15 5:28 ` Andrea Vettorello
@ 2008-10-15 5:44 ` Ross A. Laird
0 siblings, 0 replies; 4+ messages in thread
From: Ross A. Laird @ 2008-10-15 5:44 UTC (permalink / raw)
To: help-gnu-emacs
Thanks for the help. It got me started, and with a bit of
tinkering I came up with this:
\\index{\([a-z]\) --> \\index{\,(upcase \1)
I figured I better escape that first slash, as the word "index" may
appear on its own in my document. The above works perfectly.
Thanks again.
Cheers.
Ross
"Andrea Vettorello" <andrea.vettorello@gmail.com> writes:
> On Wed, Oct 15, 2008 at 7:02 AM, Ross A. Laird <ross@rosslaird.info> wrote:
>> This is the type of thing that would take me a day to figure out on my
>> own (though, probably, I could eventually figure it out), but most
>> readers of this group can probably throw me a line in a few seconds:
>>
>> I have some index entries in my tex file that are capitalized
>> \index{Capitalized} and others that are not \index{not}. I want to make
>> all entries consistently capitalized. This means a search for the first
>> character after the opening index brace and a change of its case. What's
>> the magic formula (please...).
>>
>
> Not tested, probably needs some escaping (I'm not sure if the opening
> brace should be escaped), anyway something like:
>
> M-x replace-regexp Enter
> Replace regexp: index{\(w\) Enter
> with: index{\,(capitalize \1) Enter
>
> The above should capitalize the first word after every "index{" in
> your tex file.
>
>
> --
> Andrea
>
>
>
--
Ross A. Laird, PhD
www.rosslaird.info
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-10-15 5:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-15 5:02 Capitalize letter after brace Ross A. Laird
2008-10-15 5:28 ` Andrea Vettorello
2008-10-15 5:44 ` Ross A. Laird
[not found] <mailman.1086.1224046973.25473.help-gnu-emacs@gnu.org>
2008-10-15 5:29 ` Niels Giesen
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).