Reiner Steib writes: > Is it just a wrapper around `replace-in-string' or is it Emacs > implementation of `replace-regexp-in-string'? Hm... Whatever it is, it doesn't seem to work properly. After a bug report from an XEmacs user, I now use the following function to provide this functionality for Emacs Muse. (defun muse-replace-regexp-in-string (regexp replacement text &optional fixedcase literal) "Replace REGEXP with REPLACEMENT in TEXT. If fourth arg FIXEDCASE is non-nil, do not alter case of replacement text. If fifth arg LITERAL is non-nil, insert REPLACEMENT literally." (cond ((fboundp 'replace-in-string) (replace-in-string text regexp replacement literal)) ((fboundp 'replace-regexp-in-string) (replace-regexp-in-string regexp replacement text fixedcase literal)) (t (let ((repl-len (length replacement)) start) (while (setq start (string-match regexp text start)) (setq start (+ start repl-len) text (replace-match replacement fixedcase literal text)))) text))) This prefers `replace-in-string' to `replace-regexp-in-string'. -- Michael Olson -- FSF Associate Member #652 -- http://www.mwolson.org/ Interests: Emacs Lisp, text markup, protocols -- Muse, Planner, ERC, EMMS /` |\ | | | IRC: mwolson on freenode.net: #hcoop, #muse, #PurdueLUG |_] | \| |_| Jabber: mwolson_at_hcoop.net