>>>> "APA" == Adrian Aichner
<adrian(a)xemacs.org> writes:
Sorry for the false alarm!
(let
(case-fold-search)
(message "%s"
(replace-in-string
"This %s has under 50 characters." "%S"
"string"))
(sit-for 3)
(message "%s"
(replace-in-string
"This %s, on the other hand, has just over 50 characters."
"%S" "string")))
works fine!
Thanks for the hint, Didier!
Too-trigger-happily yours,
Adrian
>>>> "APA" == Adrian Aichner
<adrian(a)xemacs.org> writes:
APA> Hi Vin, Didier,
APA> 21.1.14 shows the buggy behavior for short and long strings!
APA> (emacs-version)
APA> "XEmacs 21.1 (patch 14) \"Cuyahoga Valley\" [Lucid]
(i386-pc-win32) of Mon May 21 2001 on D5DC120J"
APA> entertains this bug for strings of any length:
APA> (replace-in-string
APA> "This %s has under 50 characters." "%S"
"string")
APA> "This string has under 50 characters."
APA> (replace-in-string
APA> "This %s, on the other hand, has just over 50 characters."
"%S" "string")
APA> "This string, on the other hand, has just over 50 characters."
APA> Didier, we might need to work around this bug in patcher.el.
APA> What do you think?
APA> Adrian
APA> Hi again!
APA> replace-in-string implements an arbitrary limit bug that would turn
APA> some guys in Redwood green with envy :-)
APA> The second r-i-s does NOT honor case-fold-search in
APA> (emacs-version)
APA> "XEmacs 21.4 (patch 9) \"Informed Management (RC1)\" [Lucid]
(i586-pc-win32) of Sat May 25 2002 on D5DC120J"
APA> "XEmacs 21.5 (beta7) \"broccoflower\" [Lucid] (i586-pc-win32,
Mule) of Sat Jul 06 2002 on D5DC120J"
APA> (with-temp-buffer
APA> (let (case-fold-search)
APA> (message
APA> "%s"
APA> (replace-in-string
APA> "%s under 50 characters in length"
APA> "%S"
APA> "STRING"
APA> t))
APA> (sit-for 3)
APA> (message
APA> "%s"
APA> (replace-in-string
APA> "This %s, on the other hand, is well over 50 characters in length"
APA> "%S"
APA> "STRING"
APA> t))))
APA> It does, however work correctly in
APA> "XEmacs 21.1 (patch 14) \"Cuyahoga Valley\" [Lucid]
(i386-pc-win32) of Mon May 21 2001 on D5DC120J"
APA> Who has the inside story?
APA> Best regards,
APA> 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/
APA> --
APA> Adrian Aichner
APA> mailto:adrian@xemacs.org
APA>
http://www.xemacs.org/
APA> --
APA> Adrian Aichner
APA> mailto:adrian@xemacs.org
APA>
http://www.xemacs.org/
--
Adrian Aichner
mailto:adrian@xemacs.org
http://www.xemacs.org/