Hi again!
replace-in-string implements an arbitrary limit bug that would turn
some guys in Redwood green with envy :-)
The second r-i-s does NOT honor case-fold-search in
(emacs-version)
"XEmacs 21.4 (patch 9) \"Informed Management (RC1)\" [Lucid]
(i586-pc-win32) of Sat May 25 2002 on D5DC120J"
"XEmacs 21.5 (beta7) \"broccoflower\" [Lucid] (i586-pc-win32, Mule) of Sat
Jul 06 2002 on D5DC120J"
(with-temp-buffer
(let (case-fold-search)
(message
"%s"
(replace-in-string
"%s under 50 characters in length"
"%S"
"STRING"
t))
(sit-for 3)
(message
"%s"
(replace-in-string
"This %s, on the other hand, is well over 50 characters in length"
"%S"
"STRING"
t))))
It does, however work correctly in
"XEmacs 21.1 (patch 14) \"Cuyahoga Valley\" [Lucid] (i386-pc-win32) of Mon
May 21 2001 on D5DC120J"
Who has the inside story?
Best regards,
Adrian
>>>> "APA" == Adrian Aichner
<adrian(a)xemacs.org> writes:
APA> It's a case-fold-search issue I haven't been able to resolve in
APA> half-an-hour.
APA> %S replacement is done, even though patcher-logmsg-commit-command
APA> %contains %s.
APA> I was able to commit my pending change using patcher.el<1.11>.
APA> case treatment in
APA> (defun replace-in-string (str regexp newtext &optional literal)
APA> is on trial.
APA> It uses re-search-forward for strings longer than 50, string-match otherwise.
APA> case treatment is undocumented for re-search-forward, depending on
APA> buffer argument for string-match.
APA> (if (> (length str) 50)
APA> (with-temp-buffer
APA> (insert str)
APA> (goto-char 1)
APA> (while (re-search-forward regexp nil t)
APA> (replace-match newtext t literal))
APA> (buffer-string))
APA> (let ((start 0) newstr)
APA> (while (string-match regexp str start)
APA> --
APA> Adrian Aichner
APA> mailto:adrian@xemacs.org
APA>
http://www.xemacs.org/
--
Adrian Aichner
mailto:adrian@xemacs.org
http://www.xemacs.org/