Hello, > It seems that the patch did not fix this bug. At least I'm > experiencing something similar with the Debian version 0.6-2. When I > click File->Export (or press CTRL-E), easychem freezes and hogs the > CPU (the gui is still updated though).
I used to have the same problem. It came from the localisation (for me at least). In French, floats are written using commas, and not dots. In easychem.c, there used to be (before patch 02) setlocale(LC_NUMERIC,"C") to circumvent this problem, but for unknown reasons, it did not work. Consequently, when exporting the eps file, it writes point positions with commas, and ghostscript really do not like them when computing the bounding box. Then easychem freezes. I wrote some patch to use the C locale for numerics during the exportation. (See attached file.) However, it would be probably better to report the fact that gs did not work instead of freezing. Best regards, Guillaume Burel PS: It is absolutely not related, but if you want, I also have a patch to make the going down bonds look better when exporting in eps/pdf. (Small bonds are really indistinguishable from going up bonds without it.)
#! /bin/sh /usr/share/dpatch/dpatch-run ## 03_locale_for_export.dpatch by <[EMAIL PROTECTED]> ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Patch to avoid freezing when exporting @DPATCH@ diff -aur easychem-0.6/easychem.c easychem-0.6.new/easychem.c --- easychem-0.6/easychem.c 2005-05-04 10:10:07.000000000 +0200 +++ easychem-0.6.new/easychem.c 2006-10-06 13:17:00.000000000 +0200 @@ -2965,6 +2965,10 @@ bindtextdomain("easychem", PREFIX "/share/locale"); textdomain ("easychem"); #endif + /* Seems to have no effect, probably reinitialised by gtk_init + setlocale (LC_NUMERIC, "C"); + * Temporaly set during exportation instead (see export.c) + */ gtk_init (&argc, &argv); signal (SIGINT, handle_signal); signal (SIGTERM, handle_signal); diff -aur easychem-0.6/export.c easychem-0.6.new/export.c --- easychem-0.6/export.c 2005-05-04 10:10:07.000000000 +0200 +++ easychem-0.6.new/export.c 2006-10-06 13:12:14.000000000 +0200 @@ -994,13 +994,17 @@ if (heading > 1) fprintf (file, "%%!PS-Adobe-2.0 EPSF-2.0\n"); if (heading != 0) - { - fprintf (file, "%%%%Title: \n"); - fprintf (file, "%%%%Creator: EasyChem " VERSION "\n"); - t = time (NULL); - fprintf (file, "%%%%CreationDate: %s", ctime (&t)); - str = (gchar *) g_get_user_name (); - fprintf (file, "%%%%For: %s", str); + { + /* Using locales may write the float with commas, so we revert to "C" */ + setlocale(LC_NUMERIC, "C"); + gettext(""); /* to initialize */ + + fprintf (file, "%%%%Title: \n"); + fprintf (file, "%%%%Creator: EasyChem " VERSION "\n"); + t = time (NULL); + fprintf (file, "%%%%CreationDate: %s", ctime (&t)); + str = (gchar *) g_get_user_name (); + fprintf (file, "%%%%For: %s", str); #ifdef UNIX gethostname (buff, SIZE); @@ -1281,7 +1285,11 @@ while ((current = current->next) != NULL); if (heading != 0) - fprintf (file, "\n\nshowpage\n"); + {fprintf (file, "\n\nshowpage\n"); + /* Back to user's locale. */ + setlocale(LC_NUMERIC, ""); + gettext(""); /* to initialize */ + } fflush (file); }