diff --git a/Box/Main.cpp b/Box/Main.cpp
index 56744759248dca98ac1183b54e9dd88277439c2f..00bf8964004c96f38525ec14ae97624cd9df4d6f 100644
--- a/Box/Main.cpp
+++ b/Box/Main.cpp
@@ -1,4 +1,4 @@
-// $Id: Main.cpp,v 1.42 2004-05-17 16:28:09 geuzaine Exp $
+// $Id: Main.cpp,v 1.43 2004-05-22 01:24:16 geuzaine Exp $
 //
 // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
 //
@@ -23,9 +23,9 @@
 #include <sys/time.h>
 #include <sys/resource.h>
 
-#ifdef __APPLE__
-#define   RUSAGE_SELF      0
-#define   RUSAGE_CHILDREN -1
+#if defined(__APPLE__)
+#define RUSAGE_SELF      0
+#define RUSAGE_CHILDREN -1
 #endif
 
 #include "ParUtil.h"
diff --git a/Common/Options.cpp b/Common/Options.cpp
index 87ead30e5d167f73131306d96700fd2164294620..c0ce4f4a148953fc83c0e0bf62f10e584a9ae2ef 100644
--- a/Common/Options.cpp
+++ b/Common/Options.cpp
@@ -1,4 +1,4 @@
-// $Id: Options.cpp,v 1.154 2004-05-17 17:40:02 geuzaine Exp $
+// $Id: Options.cpp,v 1.155 2004-05-22 01:24:16 geuzaine Exp $
 //
 // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
 //
@@ -2205,12 +2205,10 @@ double opt_general_tooltips(OPT_ARGS_NUM)
   if(action & GMSH_SET) {
     CTX.tooltips = (int)val;
 #if defined(HAVE_FLTK)
-#if !((FL_MAJOR_VERSION == 1) && (FL_MINOR_VERSION == 0))
     if(CTX.tooltips)
       Fl_Tooltip::enable();
     else
       Fl_Tooltip::disable();
-#endif
 #endif
   }
 #if defined(HAVE_FLTK)
@@ -4949,10 +4947,6 @@ double opt_print_gif_transparent(OPT_ARGS_NUM)
 
 #if defined(HAVE_FLTK)
 
-#if (FL_MAJOR_VERSION == 1) && (FL_MINOR_VERSION == 0)
-#define fl_contrast contrast
-#endif
-
 #define CCC(col,but)							\
   if(WID && (action & GMSH_GUI)){					\
     Fl_Color c = fl_color_cube(UNPACK_RED(col)*FL_NUM_RED/256, 		\
diff --git a/Common/Views.cpp b/Common/Views.cpp
index fac7cd83aef1a53b1fcad2bd743841a973ab569d..2f151c0b41ff24751905bdbd9ee11192e17352cb 100644
--- a/Common/Views.cpp
+++ b/Common/Views.cpp
@@ -1,4 +1,4 @@
-// $Id: Views.cpp,v 1.117 2004-05-12 04:31:21 geuzaine Exp $
+// $Id: Views.cpp,v 1.118 2004-05-22 01:24:16 geuzaine Exp $
 //
 // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
 //
@@ -1660,8 +1660,6 @@ void Post_View::get_raw_data(int type, List_T **list, int **nbe, int *nbc, int *
   case 21: *list = SY; *nbe = &NbSY; *nbc = 1; *nbn = 5; break;
   case 22: *list = VY; *nbe = &NbVY; *nbc = 3; *nbn = 5; break;
   case 23: *list = TY; *nbe = &NbTY; *nbc = 9; *nbn = 5; break;
-  default: 
-    Msg(FATAL, "Wrong type in Post_View::get_raw_data");
-    *list = NULL; *nbc = 0; *nbn = 0; break;
+  default: Msg(GERROR, "Wrong type in Post_View::get_raw_data"); break;
   }
 }
diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp
index 7440feeae1796570b36e706be7e9d9c4f740e315..ceb633ec775f58cb2041c84eea2df9189fc1d4c3 100644
--- a/Fltk/Callbacks.cpp
+++ b/Fltk/Callbacks.cpp
@@ -1,4 +1,4 @@
-// $Id: Callbacks.cpp,v 1.239 2004-05-19 04:50:40 geuzaine Exp $
+// $Id: Callbacks.cpp,v 1.240 2004-05-22 01:24:16 geuzaine Exp $
 //
 // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
 //
@@ -55,34 +55,6 @@ extern Context_T CTX;
 
 // File chooser (re)definitions
 
-#if (FL_MAJOR_VERSION == 1 || FL_MAJOR_VERSION == 2) && (FL_MINOR_VERSION == 0)
-
-#include <FL/fl_file_chooser.H>
-
-static char *fn = NULL;
-
-int file_chooser(int multi, int create, const char *message, 
-		 const char *pat, int patindex, char *fname=NULL)
-{
-  fn = fl_file_chooser(message, pat, fname);
-  if(fn)
-    return 1;
-  else
-    return 0;
-}
-
-char *file_chooser_get_name(int num)
-{
-  return fn;
-}
-
-int file_chooser_get_filter()
-{
-  return 0;
-}
-
-#else
-
 #include <FL/filename.H>
 #include <FL/Fl_File_Chooser.H>
 
@@ -146,8 +118,6 @@ int file_chooser_get_filter()
   return fc->filter_value();
 }
 
-#endif
-
 // arrow editor
 
 #include <FL/Fl_Value_Slider.H>
@@ -760,144 +730,11 @@ test:
   patindex = file_chooser_get_filter();
 }
 
-void file_save_as_auto_cb(CALLBACK_ARGS)
-{
-  if(file_chooser(0, 1, "Save file by extension", "*", 0))
-    _save_auto(file_chooser_get_name(1));
-}
-
-void file_save_as_geo_cb(CALLBACK_ARGS)
-{
-  if(file_chooser(0, 1, "Save GEO file", "*", 0))
-    _save_geo(file_chooser_get_name(1));
-}
-
-void file_save_as_geo_options_cb(CALLBACK_ARGS)
-{
-  if(file_chooser(0, 1, "Save option file", "*", 0))
-    _save_geo_options(file_chooser_get_name(1));
-}
-
-void file_save_as_msh_cb(CALLBACK_ARGS)
-{
-  if(file_chooser(0, 1, "Save MSH file", "*", 0))
-    _save_msh(file_chooser_get_name(1));
-}
-
-void file_save_as_msh_all_cb(CALLBACK_ARGS)
-{
-  if(file_chooser(0, 1, "Save MSH file (no physicals)", "*", 0))
-    _save_msh_all(file_chooser_get_name(1));
-}
-
-void file_save_as_unv_cb(CALLBACK_ARGS)
-{
-  if(file_chooser(0, 1, "Save UNV file", "*", 0))
-    _save_unv(file_chooser_get_name(1));
-}
-
-void file_save_as_gref_cb(CALLBACK_ARGS)
-{
-  if(file_chooser(0, 1, "Save GREF file", "*", 0))
-    _save_gref(file_chooser_get_name(1));
-}
-
-void file_save_as_vrml_cb(CALLBACK_ARGS)
-{
-  if(file_chooser(0, 1, "Save VRML file", "*", 0))
-    _save_vrml(file_chooser_get_name(1));
-}
-
-void file_save_as_ps_simple_cb(CALLBACK_ARGS)
-{
-  if(file_chooser(0, 1, "Save PS file", "*", 0))
-    _save_ps_simple(file_chooser_get_name(1));
-}
-
-void file_save_as_ps_accurate_cb(CALLBACK_ARGS)
-{
-  if(file_chooser(0, 1, "Save PS file", "*", 0))
-    _save_ps_accurate(file_chooser_get_name(1));
-}
-
-void file_save_as_epstex_simple_cb(CALLBACK_ARGS)
-{
-  if(file_chooser(0, 1, "Save LaTeX file (EPS part)", "*", 0))
-    _save_epstex_simple(file_chooser_get_name(1));
-}
-
-void file_save_as_epstex_accurate_cb(CALLBACK_ARGS)
-{
-  if(file_chooser(0, 1, "Save LaTeX file (EPS part)", "*", 0))
-    _save_epstex_accurate(file_chooser_get_name(1));
-}
-
-void file_save_as_jpegtex_cb(CALLBACK_ARGS)
-{
-  if(file_chooser(0, 1, "Save LaTeX file (JPEG part)", "*", 0))
-    _save_jpegtex(file_chooser_get_name(1));
-}
-
-void file_save_as_pngtex_cb(CALLBACK_ARGS)
-{
-  if(file_chooser(0, 1, "Save LaTeX file (PNG part)", "*", 0))
-    _save_pngtex(file_chooser_get_name(1));
-}
-
-void file_save_as_tex_cb(CALLBACK_ARGS)
-{
-  if(file_chooser(0, 1, "Save LaTeX file (TeX part)", "*", 0))
-    _save_tex(file_chooser_get_name(1));
-}
-
-void file_save_as_jpeg_cb(CALLBACK_ARGS)
-{
-  if(file_chooser(0, 1, "Save JPEG file", "*", 0))
-    _save_jpeg(file_chooser_get_name(1));
-}
-
-void file_save_as_png_cb(CALLBACK_ARGS)
-{
-  if(file_chooser(0, 1, "Save PNG file", "*", 0))
-    _save_png(file_chooser_get_name(1));
-}
-
-void file_save_as_gif_cb(CALLBACK_ARGS)
-{
-  if(file_chooser(0, 1, "Save GIF file", "*", 0))
-    _save_gif(file_chooser_get_name(1));
-}
-
-void file_save_as_gif_dithered_cb(CALLBACK_ARGS)
-{
-  if(file_chooser(0, 1, "Save GIF file", "*", 0))
-    _save_gif_dithered(file_chooser_get_name(1));
-}
-
-void file_save_as_gif_transparent_cb(CALLBACK_ARGS)
-{
-  if(file_chooser(0, 1, "Save GIF file", "*", 0))
-    _save_gif_transparent(file_chooser_get_name(1));
-}
-
-void file_save_as_ppm_cb(CALLBACK_ARGS)
-{
-  if(file_chooser(0, 1, "Save PPM file", "*", 0))
-    _save_ppm(file_chooser_get_name(1));
-}
-
-void file_save_as_yuv_cb(CALLBACK_ARGS)
-{
-  if(file_chooser(0, 1, "Save YUV file", "*", 0))
-    _save_yuv(file_chooser_get_name(1));
-}
-
 void file_quit_cb(CALLBACK_ARGS)
 {
   Exit(0);
 }
 
-
 // Option Menu
 
 void options_cb(CALLBACK_ARGS)
@@ -1260,9 +1097,6 @@ void message_cb(CALLBACK_ARGS)
 
 void message_copy_cb(CALLBACK_ARGS)
 {
-#if (FL_MAJOR_VERSION == 1) && (FL_MINOR_VERSION == 0)
-  // Fl::copy does not exist in older versions of fltk
-#else
 #define BUFFL 50000
   static char buff[BUFFL];
   strcpy(buff, "");
@@ -1283,7 +1117,6 @@ void message_copy_cb(CALLBACK_ARGS)
   // bof bof bof
   Fl::copy(buff, strlen(buff), 0);
   Fl::copy(buff, strlen(buff), 1);
-#endif
 }
 
 void message_clear_cb(CALLBACK_ARGS)
@@ -1311,28 +1144,6 @@ test:
 
 // Option Visibility Menu
 
-#if (FL_MAJOR_VERSION == 2)     // disabled for fltk 2 at the moment
-void select_vis_browser(int mode)
-{
-  ;
-}
-void visibility_cb(CALLBACK_ARGS)
-{
-  ;
-}
-void visibility_ok_cb(CALLBACK_ARGS)
-{
-  ;
-}
-void visibility_sort_cb(CALLBACK_ARGS)
-{
-  ;
-}
-void visibility_number_cb(CALLBACK_ARGS)
-{
-  ;
-}
-#else
 void select_vis_browser(int mode)
 {
   int i;
@@ -1506,7 +1317,6 @@ void visibility_number_cb(CALLBACK_ARGS)
 
   Draw();
 }
-#endif
 
 // Help Menu
 
@@ -1515,7 +1325,7 @@ void visibility_number_cb(CALLBACK_ARGS)
 // want to change all occurences of FL_CTRL with FL_COMMAND in the
 // future. FL_COMMAND would get mapped to Ctrl on Windows/Unix and to
 // Cmd on Macs.
-#ifdef __APPLE__NOT_USED_ANYMORE
+#if 0
 #define XX "Cmd "
 #else
 #define XX "Ctrl"
diff --git a/Fltk/Colorbar_Window.cpp b/Fltk/Colorbar_Window.cpp
index e54c2688b246f2615ec5fe1d00e94f14f3093458..be8ea289b2a3a6548e8f5c2f41d80eb0e86155d8 100644
--- a/Fltk/Colorbar_Window.cpp
+++ b/Fltk/Colorbar_Window.cpp
@@ -1,4 +1,4 @@
-// $Id: Colorbar_Window.cpp,v 1.37 2004-02-07 01:40:17 geuzaine Exp $
+// $Id: Colorbar_Window.cpp,v 1.38 2004-05-22 01:24:17 geuzaine Exp $
 //
 // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
 //
@@ -37,10 +37,6 @@ extern Context_T CTX;
 #define UNDEFINED   0
 #define EPS         1.e-10
 
-#if (FL_MAJOR_VERSION == 1) && (FL_MINOR_VERSION == 0)
-#define fl_contrast contrast
-#endif
-
 // This file defines the Colorbar_Window class (subclass of Fl_Window)
 
 // The constructor
diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp
index 7b82c0574a644ab7a2f57abd3d9a163a6f281841..1528539b57d087366e772e75de908d223cd5d442 100644
--- a/Fltk/GUI.cpp
+++ b/Fltk/GUI.cpp
@@ -1,4 +1,4 @@
-// $Id: GUI.cpp,v 1.303 2004-05-18 18:52:00 geuzaine Exp $
+// $Id: GUI.cpp,v 1.304 2004-05-22 01:24:17 geuzaine Exp $
 //
 // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
 //
@@ -54,24 +54,16 @@
 #include "CommandLine.h"
 #include "Solvers.h"
 
-#if (FL_MAJOR_VERSION == 1) && (FL_MINOR_VERSION == 0)
-#define WINDOW_BOX FL_FLAT_BOX
-#define TOGGLE_BOX FL_DOWN_BOX
-#define TOGGLE_COLOR FL_YELLOW
-#define RADIO_BOX  FL_DIAMOND_DOWN_BOX
-#define RADIO_COLOR FL_YELLOW
-#else
 #define WINDOW_BOX FL_FLAT_BOX
 #define TOGGLE_BOX FL_DOWN_BOX
 #define TOGGLE_COLOR FL_BLACK
 #define RADIO_BOX  FL_ROUND_DOWN_BOX
 #define RADIO_COLOR FL_BLACK
-#endif
 
-#define IW  (10*fontsize)       // input field width
-#define BB  (6*fontsize+4)      // width of a button with internal label
-#define BH  (2*fontsize+1)      // button height
-#define WB  (5) // window border
+#define IW (10*fontsize)  // input field width
+#define BB (6*fontsize+4) // width of a button with internal label
+#define BH (2*fontsize+1) // button height
+#define WB (6)            // window border
 
 extern Context_T CTX;
 
@@ -82,61 +74,20 @@ extern Context_T CTX;
 
 Fl_Menu_Item m_menubar_table[] = {
   {"&File", 0, 0, 0, FL_SUBMENU},
-    {"&New...",    FL_CTRL+'n', (Fl_Callback *)file_new_cb, 0},
-    {"&Open...",   FL_CTRL+'o', (Fl_Callback *)file_open_cb, 0},
-    {"M&erge...",  FL_CTRL+'m', (Fl_Callback *)file_merge_cb, 0, FL_MENU_DIVIDER},
-    {"Sa&ve mesh", FL_CTRL+'s', (Fl_Callback *)mesh_save_cb, 0},
-#if (FL_MAJOR_VERSION == 1) && (FL_MINOR_VERSION == 0)
-    {"Save &as",   0, 0, 0, FL_MENU_DIVIDER|FL_SUBMENU},
-      {"By &extension...",  FL_CTRL+'e', (Fl_Callback *)file_save_as_auto_cb, 0, FL_MENU_DIVIDER},
-      {"&Geometry",  0, 0, 0, FL_SUBMENU},
-         {"Gmsh current options (*.opt)...",    0, (Fl_Callback *)file_save_as_geo_options_cb, 0},
-         {"Gmsh unrolled geometry (*.geo)...",  0, (Fl_Callback *)file_save_as_geo_cb, 0},
-         {0},
-      {"&Mesh",  0, 0, 0, FL_SUBMENU},
-         {"Gmsh (*.msh)...",                    0, (Fl_Callback *)file_save_as_msh_cb, 0},
-         {"Gmsh all elements...",               0, (Fl_Callback *)file_save_as_msh_all_cb, 0},
-         {"GREF (*.gref)...",                   0, (Fl_Callback *)file_save_as_gref_cb, 0},
-         {"I-DEAS universal format (*.unv)...", 0, (Fl_Callback *)file_save_as_unv_cb, 0},
-         {"VRML lines/surfaces (*.wrl)...",     0, (Fl_Callback *)file_save_as_vrml_cb, 0},
-         {0},
-      {"&Image",  0, 0, 0, FL_SUBMENU},
-         {"GIF (*.gif)...",               0, (Fl_Callback *)file_save_as_gif_cb, 0},
-         {"GIF dithered...",              0, (Fl_Callback *)file_save_as_gif_dithered_cb, 0},
-         {"GIF transparent...",           0, (Fl_Callback *)file_save_as_gif_transparent_cb, 0},
-#if defined(HAVE_LIBJPEG)
-         {"JPEG (*.jpg)...",              0, (Fl_Callback *)file_save_as_jpeg_cb, 0},
-#endif
-#if defined(HAVE_LIBPNG)
-         {"PNG (*.png)...",               0, (Fl_Callback *)file_save_as_png_cb, 0},
-#endif
-         {"Vector PS fast (*.ps)...",     0, (Fl_Callback *)file_save_as_ps_simple_cb, 0},
-         {"Vector PS accurate...",        0, (Fl_Callback *)file_save_as_ps_accurate_cb, 0},
-         {"PPM (*.ppm)...",               0, (Fl_Callback *)file_save_as_ppm_cb, 0},
-#if defined(HAVE_LIBJPEG)
-         {"LaTeX JPEG...",                0, (Fl_Callback *)file_save_as_jpegtex_cb, 0},
-#endif
-#if defined(HAVE_LIBPNG)
-         {"LaTeX PNG...",                 0, (Fl_Callback *)file_save_as_pngtex_cb, 0},
-#endif
-         {"LaTeX Vector EPS fast...",     0, (Fl_Callback *)file_save_as_epstex_simple_cb, 0},
-         {"LaTeX Vector EPS accurate...", 0, (Fl_Callback *)file_save_as_epstex_accurate_cb, 0},
-         {"LaTeX TeX (*.tex)...",         0, (Fl_Callback *)file_save_as_tex_cb, 0},
-         {"UCB YUV (*.yuv)...",           0, (Fl_Callback *)file_save_as_yuv_cb, 0},
-         {0},
-      {0},
-#else
+    {"&New...",     FL_CTRL+'n', (Fl_Callback *)file_new_cb, 0},
+    {"&Open...",    FL_CTRL+'o', (Fl_Callback *)file_open_cb, 0},
+    {"M&erge...",   FL_CTRL+'m', (Fl_Callback *)file_merge_cb, 0, FL_MENU_DIVIDER},
+    {"Sa&ve mesh",  FL_CTRL+'s', (Fl_Callback *)mesh_save_cb, 0},
     {"Save &as...", FL_CTRL+FL_SHIFT+'s', (Fl_Callback *)file_save_as_cb, 0, FL_MENU_DIVIDER},
-#endif
     {"&Quit",       FL_CTRL+'q', (Fl_Callback *)file_quit_cb, 0},
     {0},
-  {"&Tools",0,0,0,FL_SUBMENU},
+  {"&Tools", 0, 0, 0, FL_SUBMENU},
     {"&Options...",         FL_SHIFT+'o', (Fl_Callback *)options_cb, 0},
     {"&Visibility...",      FL_SHIFT+'v', (Fl_Callback *)visibility_cb, 0},
     {"S&tatistics...",      FL_SHIFT+'i', (Fl_Callback *)statistics_cb, 0, FL_MENU_DIVIDER},
     {"M&essage console...", FL_SHIFT+'l', (Fl_Callback *)message_cb, 0},
     {0},
-  {"&Help",0,0,0,FL_SUBMENU},
+  {"&Help", 0, 0, 0, FL_SUBMENU},
     {"&Current options...",      0, (Fl_Callback *)status_xyz1p_cb, (void*)4},
     {"S&hortcuts...",            0, (Fl_Callback *)help_short_cb, 0},
     {"C&ommand line options...", 0, (Fl_Callback *)help_command_line_cb, 0, FL_MENU_DIVIDER},
@@ -421,29 +372,17 @@ int GUI::global_shortcuts(int event)
     mod_geometry_cb(0, 0);
     return 1;
   }
-#if (FL_MAJOR_VERSION == 2)
-  else if(Fl::test_shortcut('1') || Fl::test_shortcut(FL_F(1))) {
-#else
   else if(Fl::test_shortcut('1') || Fl::test_shortcut(FL_F + 1)) {
-#endif
     mesh_1d_cb(0, 0);
     mod_mesh_cb(0, 0);
     return 1;
   }
-#if (FL_MAJOR_VERSION == 2)
-  else if(Fl::test_shortcut('1') || Fl::test_shortcut(FL_F(2))) {
-#else
   else if(Fl::test_shortcut('2') || Fl::test_shortcut(FL_F + 2)) {
-#endif
     mesh_2d_cb(0, 0);
     mod_mesh_cb(0, 0);
     return 1;
   }
-#if (FL_MAJOR_VERSION == 2)
-  else if(Fl::test_shortcut('1') || Fl::test_shortcut(FL_F(3))) {
-#else
   else if(Fl::test_shortcut('3') || Fl::test_shortcut(FL_F + 3)) {
-#endif
     mesh_3d_cb(0, 0);
     mod_mesh_cb(0, 0);
     return 1;
@@ -732,7 +671,6 @@ int GUI::arrow_shortcuts()
   return 0;
 }
 
-
 // The GUI constructor
 
 GUI::GUI(int argc, char **argv)
@@ -767,15 +705,17 @@ GUI::GUI(int argc, char **argv)
   fontsize = CTX.fontsize;
 
   // set default font size
-#if !((FL_MAJOR_VERSION == 2) && (FL_MINOR_VERSION == 0))
   FL_NORMAL_SIZE = fontsize;
-#endif
 
   // handle themes and tooltip font size
-#if !((FL_MAJOR_VERSION == 1 || FL_MAJOR_VERSION == 2) && (FL_MINOR_VERSION == 0))
   if(strlen(CTX.scheme))
     Fl::scheme(CTX.scheme);
   Fl_Tooltip::size(fontsize);
+
+  // add callback to respond to the Mac Finder (when you click on a
+  // document)
+#if defined(__APPLE__)
+  fl_open_callback(OpenProblemMacFinder);
 #endif
 
   // All static windows are contructed (even if some are not
@@ -789,7 +729,7 @@ GUI::GUI(int argc, char **argv)
   m_window->icon((char *)LoadImage(fl_display, MAKEINTRESOURCE(IDI_ICON),
                                    IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR));
 #elif defined(__APPLE__)
-  // Mac icons are defined in the resource fork or in the bundle
+  // Nothing to do here
 #else
   fl_open_display();
   Pixmap p1 = XCreateBitmapFromData(fl_display, DefaultRootWindow(fl_display),
@@ -819,7 +759,6 @@ GUI::GUI(int argc, char **argv)
 
   // Draw the scene
   g_opengl_window->redraw();
-
 }
 
 // Run the GUI until no window is left
@@ -922,6 +861,7 @@ void GUI::create_menu_window(int argc, char **argv)
   m_navig_butt[0]->box(FL_FLAT_BOX);
   m_navig_butt[0]->selection_color(FL_WHITE);
   m_navig_butt[0]->callback(mod_back_cb);
+  m_navig_butt[0]->tooltip("Go back one in the menu history");
 
   m_navig_butt[1] = new Fl_Button(1, y + BH / 2, 18, BH / 2, "@#>");
   m_navig_butt[1]->labeltype(FL_SYMBOL_LABEL);
@@ -929,11 +869,7 @@ void GUI::create_menu_window(int argc, char **argv)
   m_navig_butt[1]->box(FL_FLAT_BOX);
   m_navig_butt[1]->selection_color(FL_WHITE);
   m_navig_butt[1]->callback(mod_forward_cb);
-
-#if !((FL_MAJOR_VERSION == 1) && (FL_MINOR_VERSION == 0))
-  m_navig_butt[0]->tooltip("Go back in menu history");
-  m_navig_butt[1]->tooltip("Go forward in menu history");
-#endif
+  m_navig_butt[1]->tooltip("Go forward one in the menu history");
 
   m_module_butt = new Fl_Choice(19, y, width - 24, BH);
   m_module_butt->menu(m_module_table);
@@ -955,9 +891,7 @@ void GUI::create_menu_window(int argc, char **argv)
     m_toggle2_butt[i]->labelsize(11);
     m_toggle2_butt[i]->align(FL_ALIGN_CENTER);
     m_toggle2_butt[i]->hide();
-#if !((FL_MAJOR_VERSION == 1) && (FL_MINOR_VERSION == 0))
     m_toggle2_butt[i]->tooltip("Show view option menu");
-#endif
 
     m_popup_butt[i] = new Fl_Menu_Button(width - (fontsize + 4), y + i * BH, (fontsize + 4), BH);
     m_popup_butt[i]->type(Fl_Menu_Button::POPUP123);
@@ -1089,9 +1023,7 @@ void GUI::set_context(Context_Item * menu_asked, int flag)
       m_toggle_butt[i]->show();
       m_toggle_butt[i]->value(v->Visible);
       m_toggle_butt[i]->label(v->Name);
-#if !((FL_MAJOR_VERSION == 1) && (FL_MINOR_VERSION == 0))
       m_toggle_butt[i]->tooltip(v->FileName);
-#endif
       m_toggle2_butt[i]->show();
       m_popup_butt[i]->show();
       m_popup2_butt[i]->show();
@@ -1182,27 +1114,34 @@ void GUI::create_graphic_window(int argc, char **argv)
   g_status_butt[0] = new Fl_Button(x, glheight + 2, sw, sh - 4, "X");
   x += sw;
   g_status_butt[0]->callback(status_xyz1p_cb, (void *)0);
+  g_status_butt[0]->tooltip("Set X view (Y=Z=0)");
   g_status_butt[1] = new Fl_Button(x, glheight + 2, sw, sh - 4, "Y");
   x += sw;
   g_status_butt[1]->callback(status_xyz1p_cb, (void *)1);
+  g_status_butt[1]->tooltip("Set Y view (X=Z=0)");
   g_status_butt[2] = new Fl_Button(x, glheight + 2, sw, sh - 4, "Z");
   x += sw;
   g_status_butt[2]->callback(status_xyz1p_cb, (void *)2);
+  g_status_butt[2]->tooltip("Set Z view (X=Y=0)");
   g_status_butt[3] = new Fl_Button(x, glheight + 2, 2 * fontsize, sh - 4, "1:1");
   x += 2 * fontsize;
   g_status_butt[3]->callback(status_xyz1p_cb, (void *)3);
+  g_status_butt[3]->tooltip("Set unit scale");
   g_status_butt[4] = new Fl_Button(x, glheight + 2, sw, sh - 4, "?");
   x += sw;
   g_status_butt[4]->callback(status_xyz1p_cb, (void *)4);
+  g_status_butt[4]->tooltip("Show current options");
   g_status_butt[5] = new Fl_Button(x, glheight + 2, sw, sh - 4);
   x += sw;
   g_status_butt[5]->callback(status_rewind_cb);
   rewind_bmp = new Fl_Bitmap(rewind_bits, rewind_width, rewind_height);
   rewind_bmp->label(g_status_butt[5]);
   g_status_butt[5]->deactivate();
+  g_status_butt[5]->tooltip("Rewind animation");
   g_status_butt[6] = new Fl_Button(x, glheight + 2, sw, sh - 4);
   x += sw;
   g_status_butt[6]->callback(status_play_cb);
+  g_status_butt[6]->tooltip("Play/pause animation");
   start_bmp = new Fl_Bitmap(start_bits, start_width, start_height);
   start_bmp->label(g_status_butt[6]);
   stop_bmp = new Fl_Bitmap(stop_bits, stop_width, stop_height);
@@ -1221,17 +1160,6 @@ void GUI::create_graphic_window(int argc, char **argv)
     g_status_label[i]->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE | FL_ALIGN_CLIP);
   }
 
-
-#if !((FL_MAJOR_VERSION == 1) && (FL_MINOR_VERSION == 0))
-  g_status_butt[0]->tooltip("Set X view (Y=Z=0)");
-  g_status_butt[1]->tooltip("Set Y view (X=Z=0)");
-  g_status_butt[2]->tooltip("Set Z view (X=Y=0)");
-  g_status_butt[3]->tooltip("Set unit scale");
-  g_status_butt[4]->tooltip("Show current options");
-  g_status_butt[5]->tooltip("Rewind animation");
-  g_status_butt[6]->tooltip("Play/pause animation");
-#endif
-
   // dummy resizable box
 
   Dummy_Box *resize_box = new Dummy_Box(x, 0, width - x, glheight);
@@ -1450,8 +1378,8 @@ void GUI::create_option_window()
 {
   int i;
   int width = 40 * fontsize;
-  int height = 13 * BH;
-  int BROWSERW = 110;
+  int height = 12 * BH + 5 * WB;
+  int BROWSERW = 105 + WB;
 
   if(opt_window) {
     opt_window->show();
@@ -2807,7 +2735,7 @@ PluginDialogBox *GUI::create_plugin_window(GMSH_Plugin * p)
 
   // create window
 
-  int width = 26 * fontsize;
+  int width = 27 * fontsize;
   int height = ((n+m > 8 ? n+m : 8) + 2) * BH + 5 * WB;
 
   PluginDialogBox *pdb = new PluginDialogBox;
@@ -3060,9 +2988,7 @@ void GUI::create_visibility_window()
     vis_input = new Fl_Input(3 * WB + 2 * (brw - 2 * WB) / 3, height - 2 * WB - 2 * BH,
 			     (brw - 2 * WB) / 3, BH);
     vis_input->value("*");
-#if !((FL_MAJOR_VERSION == 1) && (FL_MINOR_VERSION == 0))
     vis_input->tooltip("Enter an entity number, or *");
-#endif
   }
 
   {
diff --git a/Fltk/GUI.h b/Fltk/GUI.h
index c9488c8b507eef4d98bdfc814d7ad7b3b97d8f5b..1013d26571e3db0eca28aa796025e969a30e8745 100644
--- a/Fltk/GUI.h
+++ b/Fltk/GUI.h
@@ -44,10 +44,7 @@
 #include <FL/x.H>
 #include <FL/Fl_Color_Chooser.H>
 #include <FL/fl_ask.H>
-
-#if !((FL_MAJOR_VERSION == 1) && (FL_MINOR_VERSION == 0))
 #include <FL/Fl_Tooltip.H>
-#endif
 
 #include "Opengl_Window.h"
 #include "Colorbar_Window.h"
diff --git a/Fltk/GmshServer.cpp b/Fltk/GmshServer.cpp
index ba20a972cc405415742e827f1075646efe3e1d2b..a74cbd13699553df5d7580b49cb5c27cbf562d7f 100644
--- a/Fltk/GmshServer.cpp
+++ b/Fltk/GmshServer.cpp
@@ -1,4 +1,4 @@
-/* $Id: GmshServer.cpp,v 1.16 2004-02-07 01:40:17 geuzaine Exp $ */
+/* $Id: GmshServer.cpp,v 1.17 2004-05-22 01:24:17 geuzaine Exp $ */
 /*
  * Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
  *
@@ -126,8 +126,8 @@ int Gmsh_StartClient(char *command, char *sockname)
     return -3;  /* Error: Socket listen failed */
 
   /* Watch s to see when it has input. */
-  /* Wait up to 2 seconds */
-  tv.tv_sec = 2;
+  /* Wait up to 4 seconds */
+  tv.tv_sec = 4;
   tv.tv_usec = 0;
   FD_ZERO(&rfds);
   FD_SET(s, &rfds);
diff --git a/Fltk/Message.cpp b/Fltk/Message.cpp
index 99697dc89c821a130e52278141ed875bbe89955f..34f4213f6d3773763d234045a93112755d92ac8d 100644
--- a/Fltk/Message.cpp
+++ b/Fltk/Message.cpp
@@ -1,4 +1,4 @@
-// $Id: Message.cpp,v 1.53 2004-05-18 18:52:01 geuzaine Exp $
+// $Id: Message.cpp,v 1.54 2004-05-22 01:24:17 geuzaine Exp $
 //
 // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
 //
@@ -24,9 +24,9 @@
 #include <sys/time.h>
 #include <sys/resource.h>
 
-#ifdef __APPLE__
-#define   RUSAGE_SELF      0
-#define   RUSAGE_CHILDREN -1
+#if defined(__APPLE__)
+#define RUSAGE_SELF      0
+#define RUSAGE_CHILDREN -1
 #endif
 
 #include "Gmsh.h"
diff --git a/Fltk/Solvers.cpp b/Fltk/Solvers.cpp
index 3a846d80c8ad3d2212ad0856431445889e663589..b18f73f876a61fb6a687eb0b662dd2eab4412f95 100644
--- a/Fltk/Solvers.cpp
+++ b/Fltk/Solvers.cpp
@@ -1,4 +1,4 @@
-// $Id: Solvers.cpp,v 1.24 2004-05-15 16:09:38 geuzaine Exp $
+// $Id: Solvers.cpp,v 1.25 2004-05-22 01:24:17 geuzaine Exp $
 //
 // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
 //
@@ -67,7 +67,7 @@ int Solver(int num, char *args)
       Msg(GERROR, "Couldn't create socket '%s'", socket_name);
       break;
     case -2:
-      Msg(GERROR, "Couldn't bin socket to name '%s'", socket_name);
+      Msg(GERROR, "Couldn't bind socket to name '%s'", socket_name);
       break;
     case -3:
       Msg(GERROR, "Socket listen failed on '%s'", socket_name);
diff --git a/Graphics/ReadImg.cpp b/Graphics/ReadImg.cpp
index 2580e4328b8e3e38df8a41ed349786e62df6bc59..5fc7af243f219a277b2eb56314b53c96977d3071 100644
--- a/Graphics/ReadImg.cpp
+++ b/Graphics/ReadImg.cpp
@@ -1,4 +1,4 @@
-// $Id: ReadImg.cpp,v 1.7 2004-02-07 01:40:20 geuzaine Exp $
+// $Id: ReadImg.cpp,v 1.8 2004-05-22 01:24:17 geuzaine Exp $
 //
 // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
 //
@@ -24,14 +24,6 @@
 #include "GmshUI.h"
 #include "Views.h"
   
-#if (FL_MAJOR_VERSION == 1) && (FL_MINOR_VERSION == 0)
-
-void read_pnm(char *name) 
-{
-}
-
-#else
-
 #include <FL/Fl_PNM_Image.H>
   
 // from an image, we create a post pro object
@@ -121,5 +113,3 @@ void read_pnm(char *name)
   Msg(INFO, "Read PNM file '%s'", name);
   Msg(STATUS2N, "Read '%s'", name);
 }
-
-#endif
diff --git a/Makefile b/Makefile
index 150b75791aab385d8473b579568374523b816355..7a0d078fdf826044d8567e9257da310fb526bd28 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.344 2004-05-12 18:36:21 geuzaine Exp $
+# $Id: Makefile,v 1.345 2004-05-22 01:24:16 geuzaine Exp $
 #
 # Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
 #
@@ -212,8 +212,32 @@ package-mac:
         "    <key>CFBundleIconFile</key><string>gmsh.icns</string>\n"\
         "    <key>CFBundleSignature</key><string>GMSH</string>\n"\
         "    <key>CFBundleGetInfoString</key><string>Gmsh version ${GMSH_VERSION}, "\
-              "Copyright (C) 1997-2004 C. Geuzaine and J.-F. Remacle</string>\n"\
+                  "Copyright (C) 1997-2004 C. Geuzaine and J.-F. Remacle</string>\n"\
         "    <key>CFBundleIdentifier</key><string>org.geuz.Gmsh</string>\n"\
+        "    <key>CFBundleDocumentTypes</key>\n"\
+        "      <array>\n"\
+        "        <dict>\n"\
+        "          <key>CFBundleTypeExtensions</key><array><string>geo</string></array>\n"\
+        "          <key>CFBundleTypeIconFile</key><string>gmsh.icns</string>\n"\
+        "          <key>CFBundleTypeName</key><string>Gmsh Geometry File</string>\n"\
+        "          <key>CFBundleTypeOSTypes</key><array><string>GGEO</string></array>\n"\
+        "          <key>CFBundleTypeRole</key><string>Editor</string>\n"\
+        "        </dict>\n"\
+        "        <dict>\n"\
+        "          <key>CFBundleTypeExtensions</key><array><string>msh</string></array>\n"\
+        "          <key>CFBundleTypeIconFile</key><string>gmsh.icns</string>\n"\
+        "          <key>CFBundleTypeName</key><string>Gmsh Mesh File</string>\n"\
+        "          <key>CFBundleTypeOSTypes</key><array><string>GMSH</string></array>\n"\
+        "          <key>CFBundleTypeRole</key><string>Viewer</string>\n"\
+        "        </dict>\n"\
+        "        <dict>\n"\
+        "          <key>CFBundleTypeExtensions</key><array><string>pos</string></array>\n"\
+        "          <key>CFBundleTypeIconFile</key><string>gmsh.icns</string>\n"\
+        "          <key>CFBundleTypeName</key><string>Gmsh Post-Processing File</string>\n"\
+        "          <key>CFBundleTypeOSTypes</key><array><string>GPOS</string></array>\n"\
+        "          <key>CFBundleTypeRole</key><string>Viewer</string>\n"\
+        "        </dict>\n"\
+        "      </array>\n"\
         "  </dict>\n"\
         "</plist>" > gmsh-${GMSH_VERSION}/Gmsh.app/Contents/Info.plist
 	strip bin/gmsh
diff --git a/Mesh/2D_Mesh_Triangle.cpp b/Mesh/2D_Mesh_Triangle.cpp
index f71f0a209db507e1a5935786015ec1e0adb7dd93..bc549357169c8b45996daebe584cfd5702c8c7e0 100644
--- a/Mesh/2D_Mesh_Triangle.cpp
+++ b/Mesh/2D_Mesh_Triangle.cpp
@@ -1,4 +1,4 @@
-// $Id: 2D_Mesh_Triangle.cpp,v 1.7 2004-05-17 21:28:02 geuzaine Exp $
+// $Id: 2D_Mesh_Triangle.cpp,v 1.8 2004-05-22 01:24:17 geuzaine Exp $
 //
 // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
 //
@@ -200,8 +200,7 @@ int Mesh_Shewchuk(Surface * s)
     return 0;
   }
 
-#ifndef BGMESH
-
+  // generalize this if we have a bgmesh!
   mid.trianglearealist =
     (REAL *) Malloc(mid.numberoftriangles * sizeof(REAL));
   for(i = 0; i < mid.numberoftriangles; i++) {
@@ -215,12 +214,6 @@ int Mesh_Shewchuk(Surface * s)
     mid.trianglearealist[i] = val;
   }
 
-#else
-
-  Msg(FATAL, "Triangle is not ready to be used with a background mesh");
-
-#endif
-
   out.pointlist = NULL;
   out.pointattributelist = NULL;
   out.trianglelist = NULL;
diff --git a/Mesh/3D_Extrude.cpp b/Mesh/3D_Extrude.cpp
index a1a264374bad9fe6a74d352ff53132246d5cbe22..ca992621b5d14cd396e5e6360e2ea274b50a2add 100644
--- a/Mesh/3D_Extrude.cpp
+++ b/Mesh/3D_Extrude.cpp
@@ -1,4 +1,4 @@
-// $Id: 3D_Extrude.cpp,v 1.75 2004-04-18 03:14:55 geuzaine Exp $
+// $Id: 3D_Extrude.cpp,v 1.76 2004-05-22 01:24:17 geuzaine Exp $
 //
 // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
 //
@@ -140,7 +140,7 @@ List_T *getnxl(Vertex * v, int dim)
     }
   }
 
-  Msg(FATAL, "Could not find extruded list for vertex %d", v->Num);
+  Msg(GERROR, "Could not find extruded list for vertex %d", v->Num);
   return NULL;
 }
 
@@ -257,6 +257,8 @@ void Extrude_Simplex_Phase1(void *data, void *dum)
   L1 = getnxl(s->V[1], DIM);
   L2 = getnxl(s->V[2], DIM);
 
+  if(!L0 || !L1 || !L2) return;
+
   k = 0;
   for(i = 0; i < ep->mesh.NbLayer; i++) {
     for(j = 0; j < ep->mesh.NbElmLayer[i]; j++) {
@@ -291,6 +293,8 @@ void Extrude_Simplex_Phase2(void *data, void *dum)
   L1 = getnxl(s->V[1], DIM);
   L2 = getnxl(s->V[2], DIM);
 
+  if(!L0 || !L1 || !L2) return;
+
   k = 0;
   for(i = 0; i < ep->mesh.NbLayer; i++) {
     for(j = 0; j < ep->mesh.NbElmLayer[i]; j++) {
@@ -474,8 +478,13 @@ void Extrude_Simplex_Phase3(void *data, void *dum)
   L0 = getnxl(s->V[0], DIM);
   L1 = getnxl(s->V[1], DIM);
   L2 = getnxl(s->V[2], DIM);
-  if(s->V[3])
+
+  if(!L0 || !L1 || !L2) return;
+
+  if(s->V[3]){
     L3 = getnxl(s->V[3], DIM);
+    if(!L3) return;
+  }
 
   //printf("orig: %d %d %d %d\n",s->V[0]->Num,s->V[1]->Num,s->V[2]->Num,s->V[3]->Num);
 
@@ -657,6 +666,8 @@ void Extrude_Seg(Vertex * V1, Vertex * V2)
   L1 = getnxl(V1, DIM);
   L2 = getnxl(V2, DIM);
 
+  if(!L1 || !L2) return;
+
   k = 0;
   for(i = 0; i < ep->mesh.NbLayer; i++) {
     for(j = 0; j < ep->mesh.NbElmLayer[i]; j++) {
@@ -829,6 +840,7 @@ int Extrude_Mesh(Curve * c)
   if(ep->geo.Mode == EXTRUDED_ENTITY) {
     Extrude_Vertex(&c->beg, NULL);
     L = getnxl(c->beg, DIM);
+    if(!L) return false;
     c->Vertices = List_Create(List_Nbr(L), 2, sizeof(Vertex *));
 
     v = c->beg;
diff --git a/Mesh/3D_Extrude_Old.cpp b/Mesh/3D_Extrude_Old.cpp
index aedab30bbfaee29e78899c59607dfbcc8835f27b..1713068960404a83c0065f233b387170fbcbea4e 100644
--- a/Mesh/3D_Extrude_Old.cpp
+++ b/Mesh/3D_Extrude_Old.cpp
@@ -1,4 +1,4 @@
-// $Id: 3D_Extrude_Old.cpp,v 1.25 2004-02-07 01:40:21 geuzaine Exp $
+// $Id: 3D_Extrude_Old.cpp,v 1.26 2004-05-22 01:24:18 geuzaine Exp $
 //
 // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
 //
@@ -97,8 +97,10 @@ static void InitExtrudeParams(void)
 
   printf("Number of layers: ");
   scanf("%d", &NbLayer);
-  if(NbLayer > MAXLAYERS)
-    Msg(FATAL, "Max number of layer (%d) exceeded", MAXLAYERS);
+  if(NbLayer > MAXLAYERS){
+    Msg(GERROR, "Max number of layer (%d) exceeded", MAXLAYERS);
+    NbLayer = MAXLAYERS;
+  }
 
   file = fopen("xtrude", "w");
 
diff --git a/Mesh/Create.cpp b/Mesh/Create.cpp
index 0c2ba658b21e62db71594429f770aae103c33c77..db6316f08a21d2f365f0ec3f296cac675efb6158 100644
--- a/Mesh/Create.cpp
+++ b/Mesh/Create.cpp
@@ -1,4 +1,4 @@
-// $Id: Create.cpp,v 1.52 2004-05-18 18:52:01 geuzaine Exp $
+// $Id: Create.cpp,v 1.53 2004-05-22 01:24:18 geuzaine Exp $
 //
 // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
 //
@@ -612,8 +612,10 @@ Curve *Create_Curve(int Num, int Typ, int Order, List_T * Liste,
       List_Read(Liste, j, &iPnt);
       if((v = FindPoint(iPnt, THEM)))
         List_Add(pC->Control_Points, &v);
-      else
-        Msg(FATAL, "Unknown control point %d in Curve %d", iPnt, pC->Num);
+      else{
+        Msg(GERROR, "Unknown control point %d in Curve %d", iPnt, pC->Num);
+	pC->Dirty = 1;
+      }
     }
   }
   else {
@@ -627,21 +629,20 @@ Curve *Create_Curve(int Num, int Typ, int Order, List_T * Liste,
   }
   else {
     if((v = FindPoint(p1, THEM))) {
-      pC->beg = v;
       Msg(INFO, "Curve %d first control point %d ", pC->Num, v->Num);
+      pC->beg = v;
     }
     else {
-      List_Read(pC->Control_Points, 0, &pC->beg);
       Msg(GERROR, "Unknown control point %d in Curve %d", p1, pC->Num);
+      pC->Dirty = 1;
     }
     if((v = FindPoint(p2, THEM))) {
-      pC->end = v;
       Msg(INFO, "Curve %d first control point %d ", pC->Num, v->Num);
+      pC->end = v;
     }
     else {
-      List_Read(pC->Control_Points, List_Nbr(pC->Control_Points) - 1,
-                &pC->end);
       Msg(GERROR, "Unknown control point %d in Curve %d", p2, pC->Num);
+      pC->Dirty = 1;
     }
   }
 
diff --git a/Mesh/Interpolation.cpp b/Mesh/Interpolation.cpp
index 24e81f1cd3eeeaaf9001dd40505a90046e7532f2..ca0b1dc2ff986370e67d6606ce23a1edf21ec8a5 100644
--- a/Mesh/Interpolation.cpp
+++ b/Mesh/Interpolation.cpp
@@ -1,4 +1,4 @@
-// $Id: Interpolation.cpp,v 1.24 2004-02-28 00:48:50 geuzaine Exp $
+// $Id: Interpolation.cpp,v 1.25 2004-05-22 01:24:18 geuzaine Exp $
 //
 // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
 //
@@ -248,7 +248,9 @@ Vertex InterpolateCurve(Curve * Curve, double u, int derivee)
     return V;
 
   default:
-    Msg(FATAL, "Unknown curve type in interpolation");
+    Msg(GERROR, "Unknown curve type in interpolation");
+    V.Pos.X = V.Pos.Y = V.Pos.Z = 0.0;
+    V.w = V.lc = 1.0;
     return V;
   }
 
@@ -467,7 +469,9 @@ Vertex InterpolateSurface(Surface * s, double u, double v,
     return (T);
 
   default:
-    Msg(FATAL, "Unknown surface type in interpolation");
+    Msg(GERROR, "Unknown surface type in interpolation");
+    T.Pos.X = T.Pos.Y = T.Pos.Z = 0.0;
+    T.w = T.lc = 1.0;
     return T;
   }
 
diff --git a/Parser/OpenFile.cpp b/Parser/OpenFile.cpp
index caaddeabe9f38842dcacfee0153ddc7046d9dcf7..302098645d06a2d8ae29e07824cbdf784a9cfb59 100644
--- a/Parser/OpenFile.cpp
+++ b/Parser/OpenFile.cpp
@@ -1,4 +1,4 @@
-// $Id: OpenFile.cpp,v 1.54 2004-05-14 18:23:58 geuzaine Exp $
+// $Id: OpenFile.cpp,v 1.55 2004-05-22 01:24:18 geuzaine Exp $
 //
 // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
 //
@@ -286,6 +286,27 @@ void OpenProblem(char *name)
 #endif
 }
 
+void OpenProblemMacFinder(const char *filename)
+{
+  static int first = 1;
+  if(first){
+    // just copy the filename: it will be opened when Gmsh is ready in
+    // main() (calling OpenProblem right now would be a bad idea: Gmsh
+    // is probably not completely initialized)
+    strncpy(CTX.filename, filename, 255);
+    first = 0;
+  }
+  else{
+    // should we do MergeProblem instead? not sure what's the most
+    // intuitive
+    OpenProblem((char*)filename);
+#if defined(HAVE_FLTK)
+    Draw();
+    DrawUI();
+#endif
+  }
+}
+
 // replace "/cygwin/x/" with "x:/"
 void decygwin(char *in, char *out)
 {
diff --git a/Parser/OpenFile.h b/Parser/OpenFile.h
index 2da6f53f3a4bd1ca7a2f760ed34919ee73ad9f65..8f49d5ca74008448b391ede4ad44d1df0b06b9f6 100644
--- a/Parser/OpenFile.h
+++ b/Parser/OpenFile.h
@@ -23,6 +23,7 @@
 int  ParseFile(char *filename, int silent, int close, int warn_if_missing=0);
 void ParseString(char *str);
 void OpenProblem(char *filename);
+void OpenProblemMacFinder(const char *filename);
 int MergeProblem(char *filename, int warn_if_missing=0);
 void SystemCall(char *command);
 void FixRelativePath(char *in, char *out);
diff --git a/Plugin/Plugin.cpp b/Plugin/Plugin.cpp
index 2ae0dc8b7b4d15cbbaa0ec75e26c2d25c12834a9..4a93ad60f78dbc88f37ee2fa0e8483ca70e0cf73 100644
--- a/Plugin/Plugin.cpp
+++ b/Plugin/Plugin.cpp
@@ -1,4 +1,4 @@
-// $Id: Plugin.cpp,v 1.51 2004-05-12 02:02:30 geuzaine Exp $
+// $Id: Plugin.cpp,v 1.52 2004-05-22 01:24:18 geuzaine Exp $
 //
 // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
 //
@@ -179,11 +179,7 @@ void GMSH_PluginManager::registerDefaultPlugins()
   char *homeplugins = getenv("GMSHPLUGINSHOME");
   if(!homeplugins)
     return;
-#if (FL_MAJOR_VERSION == 1 || FL_MAJOR_VERSION == 2) && (FL_MINOR_VERSION == 0)
-  int nbFiles = filename_list(homeplugins, &list);
-#else
   int nbFiles = fl_filename_list(homeplugins, &list);
-#endif
   if(nbFiles <= 0)
     return;
   for(int i = 0; i < nbFiles; i++) {
diff --git a/TODO b/TODO
index 288dd9a8f746d8abcb30f36a05ff5236fcce9062..82e74dc466f66b236a9aa69ca1f0cd2df3e7c375 100644
--- a/TODO
+++ b/TODO
@@ -1,4 +1,4 @@
-$Id: TODO,v 1.47 2004-05-18 04:54:49 geuzaine Exp $
+$Id: TODO,v 1.48 2004-05-22 01:24:16 geuzaine Exp $
 
 add ternary operator and <,>,<=,>=,== tests in MathEval
 
@@ -44,6 +44,10 @@ The "Symmetry" operation should be renamed "Reflection"
 
 ********************************************************************
 
+Attractors in the 2D aniso algo are extremely buggy
+
+********************************************************************
+
 Memory leaks, memory leaks
 
 - start with mesh_domain() and the parser
diff --git a/doc/VERSIONS b/doc/VERSIONS
index 4cb37deb91ec17cafc7a50576590443cd50b3423..b9089045a8f148597ccc591a0dba2ef8639f2108 100644
--- a/doc/VERSIONS
+++ b/doc/VERSIONS
@@ -1,4 +1,4 @@
-$Id: VERSIONS,v 1.208 2004-05-19 03:56:08 geuzaine Exp $
+$Id: VERSIONS,v 1.209 2004-05-22 01:24:18 geuzaine Exp $
 
 New since 1.52: various background mesh fixes and enhancements; new
 Plugin(Evaluate) to evaluate arbitrary expressions on post-processing
@@ -7,7 +7,8 @@ components; generalized "Coherence" to handle transfinite
 surface/volume attributes; plugin options can now be set in the option
 file (like all other options); added "undo" capability during geometry
 creation; rewrote the contour guessing routines so that entities can
-be selected in an arbitrary order; many small cleanups;
+be selected in an arbitrary order; Mac users can now double click on
+geo/msh/pos files in the Finder to launch Gmsh; many small cleanups;
 
 New in 1.52: new raster ("bitmap") PostScript/EPS/PDF output formats;
 new Plugin(Extract) to extract a given component from a
diff --git a/doc/texinfo/gmsh.texi b/doc/texinfo/gmsh.texi
index 669dc889551ece61f94c3b6a44012fddaadd2335..e058640c1e955d9913cf3d75946aae6f3def31f3 100644
--- a/doc/texinfo/gmsh.texi
+++ b/doc/texinfo/gmsh.texi
@@ -1,5 +1,5 @@
 \input texinfo.tex @c -*-texinfo-*-
-@c $Id: gmsh.texi,v 1.108 2004-05-18 17:00:37 geuzaine Exp $
+@c $Id: gmsh.texi,v 1.109 2004-05-22 01:24:18 geuzaine Exp $
 @c
 @c Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
 @c
@@ -37,7 +37,7 @@
 @c =========================================================================
 @c %**start of header
 @setfilename        gmsh.info
-@set EDITION        1.20
+@set EDITION        1.21
 @set GMSH-VERSION   1.52
 @set GMSH-WEB       @uref{http://www.geuz.org/gmsh/}
 @set COPYRIGHT      @copyright{} 1997-2004 Christophe Geuzaine, Jean-Fran@,{c}ois Remacle
@@ -1864,8 +1864,8 @@ You can use geometrical ``attractors'', an elaborate version of the method
 described in the preceding item: see the definition of the @code{Attractor}
 command below.
 
-Note that attractors currently only work with the 2D anisotropic algorithm
-(see the @code{Mesh.Algorithm} option in @ref{Mesh options}).
+Attractors only work with the 2D anisotropic algorithm (see the
+@code{Mesh.Algorithm} option in @ref{Mesh options}).
 @item
 You can give Gmsh an explicit background mesh in the form of a scalar
 post-processing view (see @ref{Post-processing commands}, and @ref{File
@@ -1898,6 +1898,9 @@ and only works with the 2D anisotropic algorithm (see @code{Mesh.Algorithm}
 in @ref{Mesh options}).  An example of the use of attractors is given in
 @ref{t7.geo}.
 
+Please note that attractors are an @emph{experimental} feature (to be
+considered @emph{at most} alpha-quality...). Use at your own risk.
+
 @item Characteristic Length @{ @var{expression-list} @} = @var{expression};
 Modifies the characteristic length of the points whose identification
 numbers are listed in @var{expression-list}. The new value is given by
diff --git a/tutorial/t7.geo b/tutorial/t7.geo
index 54fdfc739599e00efb2b0f52043ee00d3acb99b9..495f994ecbcef088f3bf6cb5f1c10288141fb663 100644
--- a/tutorial/t7.geo
+++ b/tutorial/t7.geo
@@ -39,7 +39,8 @@ Line(5) = {11,22};
 Spline(7) = {4,5,12,2};
 
 // Isotropic and anisotropic attractors can be defined on points and
-// lines:
+// lines (this is still experimental and known to be unstable: use at
+// your own risk!):
 
 Attractor Point{1} = {0.01, 0.01, 2};
 
diff --git a/tutorial/view4.pos b/tutorial/view4.pos
index 340cfffb892b028d573634410dad4f34bb838edb..0680f010814526016abe4f339b928a29e65e6352 100644
--- a/tutorial/view4.pos
+++ b/tutorial/view4.pos
@@ -112,7 +112,7 @@ SP(0.05,0.3,0){0,0,0,0,0};
 View "e" {
 SP(0.05,0.2,0){1939799.2,-3879808.7,1939891.9,1939888.6,-3880387.9};
 T2(10,-12,0){"File created on Fri Oct 18 23:50:20 2002"};
-T2(220,-12,0){"First time step", "Second time step", "Third time step",
+T2(General.GraphicsWidth/2,-12,0){"First time step", "Second time step", "Third time step",
               "Fourth time step", "Last time step!"};
 T3(0.1,0,0,0){"This is a 3D string, defined in model coordinates"};
 T3(0.1,0.3,0,0){"Test 1","Test 2","Test 3","Test 4","Test 5","Test 6","Test 7"};
diff --git a/utils/solvers/GmshClient.c b/utils/solvers/GmshClient.c
index 6ba85535bed62de051c07f83439a47459f9c15a0..6f32c893a00519caa69096bc76edcc533b530487 100644
--- a/utils/solvers/GmshClient.c
+++ b/utils/solvers/GmshClient.c
@@ -1,4 +1,4 @@
-/* $Id: GmshClient.c,v 1.4 2004-02-07 01:40:35 geuzaine Exp $ */
+/* $Id: GmshClient.c,v 1.5 2004-05-22 01:24:19 geuzaine Exp $ */
 /*
  * Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
  *
@@ -96,6 +96,7 @@ int Gmsh_Connect(char *sockname)
   for(tries = 0; tries < 5; tries++) {
     if(connect(sock, (struct sockaddr *)&addr, len) >= 0)
       return sock;
+    Socket_Idle(0.1);
   }
 
   return -2;    /* Error: Couldn't connect */
diff --git a/utils/solvers/mysolver.c b/utils/solvers/mysolver.c
index c9d4e430ef5870324a635012eb8075203a39b2a9..0276385e2980468a0e760e9044bfbdaee4618474 100644
--- a/utils/solvers/mysolver.c
+++ b/utils/solvers/mysolver.c
@@ -1,4 +1,4 @@
-/* $Id: mysolver.c,v 1.4 2004-03-13 21:00:20 geuzaine Exp $ */
+/* $Id: mysolver.c,v 1.5 2004-05-22 01:24:19 geuzaine Exp $ */
 /*
  * Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
  *
@@ -35,10 +35,14 @@
 
    gcc -o mysolver.exe mysolver.c GmshClient.c
    
-   To test this solver, copy the mysolver.opt file into your default
-   Gmsh option file, or lauch Gmsh with the command:
+   To run it, merge the contents of the file mysolver.opt into your
+   default Gmsh option file, or lauch Gmsh with the command:
    
-   gmsh -option mysolver.opt */
+   gmsh -option mysolver.opt 
+
+   You will then see a new button labeled "My C solver" in Gmsh's
+   solver menu.
+*/
 
 /* We start by including some standard headers. Under Windows, you
    will need to install the cygwin tools (http://www.cygwin.com) to