commit: (main branch) redo capitalize-string-as-title
Ben Wing
ben at xemacs.org
Thu Feb 4 01:30:32 EST 2010
changeset: 4946:9b5d4b35f8d7
user: Ben Wing <ben at xemacs.org>
date: Sun Jan 24 00:27:03 2010 -0600
files: lisp/ChangeLog lisp/simple.el
description:
(main branch) redo capitalize-string-as-title
-------------------- ChangeLog entries follow: --------------------
lisp/ChangeLog addition:
2010-01-24 Ben Wing <ben at xemacs.org>
* 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 <ben at xemacs.org>
+
+ * simple.el (capitalize-string-as-title):
+ Use `with-string-as-buffer-contents' instead of emulating it.
+
2010-01-24 Ben Wing <ben at xemacs.org>
* 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).
More information about the XEmacs-Patches
mailing list