diff options
author | David Aspinall <da@inf.ed.ac.uk> | 2002-11-07 21:38:50 +0000 |
---|---|---|
committer | David Aspinall <da@inf.ed.ac.uk> | 2002-11-07 21:38:50 +0000 |
commit | 0fdff8096d68fa6aa83c1f817f769e4b1f8a30af (patch) | |
tree | b1aef2f62889be9c84a3cc2216c34676dc95036e /generic | |
parent | 9f5a4ab6a1cc4a0184edc98f0a8efd26fa3cb32b (diff) |
Add subst-char-in-string (Monnier patch) for XEmacs.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/proof-compat.el | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/generic/proof-compat.el b/generic/proof-compat.el index d2c9da28..e0a74a99 100644 --- a/generic/proof-compat.el +++ b/generic/proof-compat.el @@ -60,6 +60,19 @@ that use a window system such as X, and false for text-only terminals." (or (eq (console-type) 'x) (eq (console-type) 'mswindows)))) +(or (fboundp 'subst-char-in-string) +;; Code is taken from Emacs 21.2.1/subr.el +(defun subst-char-in-string (fromchar tochar string &optional inplace) + "Replace FROMCHAR with TOCHAR in STRING each time it occurs. +Unless optional argument INPLACE is non-nil, return a new string." + (let ((i (length string)) + (newstr (if inplace string (copy-sequence string)))) + (while (> i 0) + (setq i (1- i)) + (if (eq (aref newstr i) fromchar) + (aset newstr i tochar))) + newstr))) + (or (fboundp 'replace-regexp-in-string) ;; Code is taken from Emacs 21.1.1/subr.el (defun replace-regexp-in-string (regexp rep string &optional |