From: Dan S. <seg...@ma...> - 2001-11-02 17:43:19
|
There is a very strange bug lurking somewhere in the Mac Emacs 21 code. I exchanged some private email with Andrew Choi (thanks again, Andrew!), and at least we're both getting the same results. At 19:29 -0600 2001-10-30, Dan Sommers wrote: > Copied and pasted from my *scratch* buffer: > > (format "%f" 1.0) ; "%f" loses > "0.000000" > (format "%s" 1.0) ; "%s" wins > "1.0" > > I traced this one all the way down to the call to sprintf on > line 3416 of editfns.c, and everything looks good except > sprintf's output. it happens with or without my .emacs file, > and with various compiler optimization and PPC processor > settings. I'm using CodeWarrior 5.3 and [the] pre-packaged > project, and Mac OS 9.0.4, if that makes any difference. I'll > give it a shot later with MPW, as soon as I finish downloading > it (at 56K...). > > I think this bug also existed in Mac Emacs 20.6. I tracked it > down because of strange output from ps-print (*everything* was > black, including the background), and I had that same symptom > in 20.6. [ Aside: ps-print loses because it depends on (format "%f ...) to format RGB values, and if (format "%f" ...) keeps returning "0.000000," then all those colors are *black*. As a temporary work-around for this particular problem, I added this to my .emacs file: ;; Mac Emacs (format "%f" 1.0) loses; these kluges prevent ;; ps-print from losing, too.... (setq ps-color-format " %s %s %s " ps-float-format " %s ") End of aside. ] At 13:58 +0800 2001-11-02, Andrew Choi wrote: > Thank you for the bug report. I've spent some time on it and I > must say I'm baffled. I added a simple block > > { > char s[20]; > > sprintf(s, "%f", 1.0); > } > > at the beginning of main() and that works correctly. I also > added this block right after the sprintf line in questions (in > Fformat() in editfns.c) and it didn't work. I also tried > `(format "%f" 1.0)' in the MPW version and that gives a > "0.000000" also. Perhaps I can post this to mac-emacs-devel and > see if other people have some ideas. I had tried these things in the mean time, too, and got the same results, and that's where we are. Any ideas? Thanks, Dan -- Dan Sommers, Esq., Ltd., The Third mailto:seg...@ma... |