# HG changeset patch # User Ben Wing # Date 1264314423 21600 # Node ID 9b5d4b35f8d7dbec345c99c89d137c11404b0c0f # Parent 99e465e2da2e8370aa6e1e04b131eca475beffa0 (main branch) redo capitalize-string-as-title -------------------- ChangeLog entries follow: -------------------- lisp/ChangeLog addition: 2010-01-24 Ben Wing * simple.el (capitalize-string-as-title): Use `with-string-as-buffer-contents' instead of emulating it. diff -r 99e465e2da2e -r 9b5d4b35f8d7 lisp/ChangeLog --- a/lisp/ChangeLog Sun Jan 24 00:26:10 2010 -0600 +++ b/lisp/ChangeLog Sun Jan 24 00:27:03 2010 -0600 @@ -1,3 +1,8 @@ +2010-01-24 Ben Wing + + * simple.el (capitalize-string-as-title): + Use `with-string-as-buffer-contents' instead of emulating it. + 2010-01-24 Ben Wing * syntax.el: diff -r 99e465e2da2e -r 9b5d4b35f8d7 lisp/simple.el --- a/lisp/simple.el Sun Jan 24 00:26:10 2010 -0600 +++ b/lisp/simple.el Sun Jan 24 00:27:03 2010 -0600 @@ -3835,13 +3835,8 @@ (defun capitalize-string-as-title (string) "Capitalize the words in the string, except for small words (as in titles). The words not capitalized are specified in `uncapitalized-title-words'." - (let ((buffer (get-buffer-create " *capitalize-string-as-title*"))) - (unwind-protect - (progn - (insert-string string buffer) - (capitalize-region-as-title 1 (point-max buffer) buffer) - (buffer-string buffer)) - (kill-buffer buffer)))) + (with-string-as-buffer-contents string + (capitalize-region-as-title (point-min) (point-max)))) (defun capitalize-region-as-title (b e &optional buffer) "Capitalize the words in the region, except for small words (as in titles).