From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "B. T. Raven" Newsgroups: gmane.emacs.help Subject: Re: Help with upcasing words first char Date: Sun, 23 Aug 2009 13:14:51 -0500 Message-ID: <3-OdndnFQsSKGgzXnZ2dnUVZ_radnZ2d@sysmatrix.net> References: <87ab1ru9zt.fsf@newsguy.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1251052958 17643 80.91.229.12 (23 Aug 2009 18:42:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 23 Aug 2009 18:42:38 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Aug 23 20:42:31 2009 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 1MfI1O-0007Wy-FD for geh-help-gnu-emacs@m.gmane.org; Sun, 23 Aug 2009 20:42:30 +0200 Original-Received: from localhost ([127.0.0.1]:50222 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MfI1N-00067t-Vy for geh-help-gnu-emacs@m.gmane.org; Sun, 23 Aug 2009 14:42:30 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!news.glorb.com!news2.glorb.com!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!backlog2.nntp.dca.giganews.com!nntp.sysmatrix.net!news.sysmatrix.net.POSTED!not-for-mail Original-NNTP-Posting-Date: Sun, 23 Aug 2009 13:14:46 -0500 User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) Original-Newsgroups: gnu.emacs.help In-Reply-To: X-No-Archive: yes Original-Lines: 95 X-Usenet-Provider: http://www.giganews.com Original-NNTP-Posting-Host: 12.73.132.196 Original-X-Trace: sv3-qz0buoTGMU0kXqz3IfapRnUPjBsovPR/HAA3PK08NVlX72rBq212gyuYcilq+8aIGOu7WJVPvwiOYSZ!v1ABOe5Sxm6ETHAo1lDSgWTM1Z6RYrC9LiSFqOCbp4zWTdwcMZk8FG3YCaWqqGDHO9Ko0pl7sdsr!WH7pFA2dAAOXMM6xjaeXis8qzg17pno= Original-X-Complaints-To: abuse@sysmatrix.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.39 X-Original-Bytes: 3699 Original-Xref: news.stanford.edu gnu.emacs.help:172301 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 X-Gmane-Expiry: 2009-09-06 Xref: news.gmane.org gmane.emacs.help:67455 Archived-At: Harry Putnam wrote: > Harry Putnam writes: > >> I need to do a pile of editing that involves: >> >> Removing a space between words and upcasing the first letter of the >> next word like: >> >> Some example >> to >> SomeExample >> >> I went thru M-x apropos >> >> But didn't find a likely candidate ... or at least none appeared to be >> the right thing for what I want. >> >> So far I've been >> >> Ctrl To get to the space between words >> Ctrl-d Ctrl-d To remove the space and the leading lowercase char of >> the next word >> >> Shift to replace with uppercase >> >> Then back to Ctrl >> >> Where can I save some keyboard strokes? > > Just to add a bit here... > > I realize that upcase-region can do the above but its actually more > cumbersome that what I described above and appears to need more > keystrokes too > > create region/call upcase region > > Maybe its the same number of strokes but more inconvenient in that it > breaks the movements up in a different way than > > My current method: > ctrl- | Ctrl-d | ctrl-d | shift > > Using upcase-region > ctrl- > It even looks more awkward in writting. > > But really, either of those above seems too time consuming when I have > hundreds of edits to make in that manner. > > Incidentally ... it appears `Ctrl-' keystrokes to move > to next space between words, is only available on windows UI. At > least I don't see it on my linux OS. > > > Any suggestions about how to automate or reduce time on these edits? > > > Once more... the edit: > > Some words similar to this > > I need to remove the space and upcase the next Char. > > SomeWordsSimilarToThis > > > This almost works: (defun cap-n-crunch-region (beg end) (interactive "r") (capitalize-region beg end) (goto-char beg) (while (search-forward " " end t) (replace-match "" nil t)) ) It produced (only when quoted in the buffer!): "OneTwoThreeFour" Someone who knows elisp could fix it and then the interactive function could be assigned to key combo or alias: (global-set-key [(super c)] 'cap-n-crunch-region) (defalias 'ccr 'cap-n-crunch-region) Ed