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

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

Re: Randomly capitalise letters


From: Burton Samograd
Subject: Re: Randomly capitalise letters
Date: Fri, 23 Nov 2012 08:22:25 -0700
User-agent: Gnus/5.1299999999999999 (Gnus v5.13) Emacs/24.2.50 (cygwin)

Stefan Monnier <address@hidden> writes:

>>     (while (not (= start end))
>>       (if (= 0 (random downcase-factor))
>>           (upcase-region start (1+ start)))
>>       (incf start))))
>
> You could speed it up with something like
>
>     (while (< start end)
>       (upcase-region start (1+ start))
>       (incf start (+ 1 (random downcase-factor))))

Good idea in case you want to random-case 'War and Peace' :)

--
Burton Samograd




reply via email to

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