help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with upcasing words first char


From: Harry Putnam
Subject: Re: Help with upcasing words first char
Date: Sat, 29 Aug 2009 20:42:24 -0500
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.96 (gnu/linux)

pjb@informatimago.com (Pascal J. Bourguignon) writes:

> Using goto-char, you can position the cursor at the position you want:
>  
> (defun camelize-region (start end)
>   (interactive "r")
>   (capitalize-region start end)
>   (let ((end (let ((m (make-marker))) (set-marker m end) m)))
>     (unwind-protect
>          (progn
>            (goto-char start)
>            (while (re-search-forward "[ \t]+" end t) 
>              (delete-region (match-beginning 0) (match-end 0))))
>       (goto-char end)
>       (set-marker end nil))))


Very nice... thanks again.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]