Mercurial > hg > xemacs-beta
changeset 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 | 99e465e2da2e |
children | 4faad22a9fe5 |
files | lisp/ChangeLog lisp/simple.el |
diffstat | 2 files changed, 7 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- 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 <ben@xemacs.org> + + * simple.el (capitalize-string-as-title): + Use `with-string-as-buffer-contents' instead of emulating it. + 2010-01-24 Ben Wing <ben@xemacs.org> * syntax.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).