From 0fdff8096d68fa6aa83c1f817f769e4b1f8a30af Mon Sep 17 00:00:00 2001 From: David Aspinall Date: Thu, 7 Nov 2002 21:38:50 +0000 Subject: Add subst-char-in-string (Monnier patch) for XEmacs. --- generic/proof-compat.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 -- cgit v1.2.3