[CEDET-devel] current semantic XEmacs compatibity.
Brought to you by:
zappo
From: Andrey S. <an...@in...> - 2004-10-16 02:57:02
|
Hi, subst-char-in-string is not found on the XEmacs <= 21.4 Patch is defined this function: --8<---------------cut here---------------start------------->8--- --- semanticdb-file.el.orig Sat Oct 16 04:59:32 2004 +++ semanticdb-file.el Sat Oct 16 05:49:44 2004 @@ -397,6 +397,22 @@ (apply #'concat (nreverse matches))))) ) +;; subst-char-in-string is not found on the XEmacs <= 21.4. Provide +;; here for compatibility. + +(if (not (fboundp 'subst-char-in-string)) + +(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)) +) (provide 'semanticdb-file) --8<---------------cut here---------------end--------------->8--- -- Andrey Slusar. |