Mercurial > hg > xemacs-beta
diff lisp/simple.el @ 4946:9b5d4b35f8d7
(main branch) redo capitalize-string-as-title
-------------------- ChangeLog entries follow: --------------------
lisp/ChangeLog addition:
2010-01-24 Ben Wing <ben@xemacs.org>
* simple.el (capitalize-string-as-title):
Use `with-string-as-buffer-contents' instead of emulating it.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Sun, 24 Jan 2010 00:27:03 -0600 |
parents | e533a9912ef1 |
children | db2db229ee82 |
line wrap: on
line diff
--- 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).