From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ross@rosslaird.info (Ross A. Laird) Newsgroups: gmane.emacs.help Subject: Re: Capitalize letter after brace Date: Tue, 14 Oct 2008 22:44:23 -0700 Message-ID: <87od1mh0p4.fsf@rosslaird.info> References: <87vdvuh2mv.fsf@rosslaird.info> <7d5440240810142228x4350a155t8af02cc70ad68117@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1224049524 32142 80.91.229.12 (15 Oct 2008 05:45:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 15 Oct 2008 05:45:24 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 15 07:46:24 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KpzDB-0003E4-1i for geh-help-gnu-emacs@m.gmane.org; Wed, 15 Oct 2008 07:46:21 +0200 Original-Received: from localhost ([127.0.0.1]:53649 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KpzC6-0000GS-9z for geh-help-gnu-emacs@m.gmane.org; Wed, 15 Oct 2008 01:45:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KpzBQ-00008z-Fi for help-gnu-emacs@gnu.org; Wed, 15 Oct 2008 01:44:32 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KpzBO-00007D-2J for help-gnu-emacs@gnu.org; Wed, 15 Oct 2008 01:44:31 -0400 Original-Received: from [199.232.76.173] (port=49021 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KpzBN-00006k-Nv for help-gnu-emacs@gnu.org; Wed, 15 Oct 2008 01:44:29 -0400 Original-Received: from main.gmane.org ([80.91.229.2]:56514 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KpzBN-0007ei-MP for help-gnu-emacs@gnu.org; Wed, 15 Oct 2008 01:44:30 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KpzBL-0007NA-Ib for help-gnu-emacs@gnu.org; Wed, 15 Oct 2008 05:44:27 +0000 Original-Received: from h24-207-48-89.dlt.dccnet.com ([24.207.48.89]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 Oct 2008 05:44:27 +0000 Original-Received: from ross by h24-207-48-89.dlt.dccnet.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 Oct 2008 05:44:27 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 49 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: h24-207-48-89.dlt.dccnet.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:qnQweBSlEjK9g9rdJwTijYk97ec= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:58793 Archived-At: 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" writes: > On Wed, Oct 15, 2008 at 7:02 AM, Ross A. Laird 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