From: Petr M. <mi...@ph...> - 2009-10-24 08:45:58
|
> > It is neither nice or useful when gnuplot is writing error message such as: > > > > Error: terminal "dumb" does not support continuous colors. > > This terminal does not support palette-based images. > > This terminal does not support rgb images. > > This terminal does not support filled polygons. > > > > when in non-interactive mode (e.g. driven via Octave). They are actually > > just warnings, not errors. > > Every message that is generated by > fprintf(stderr,ERROR_NOTICE(foo)) > should be changed to use int_warn() instead. Good idea. These ERROR_NOTICEs are actually warnings only, not errors. I've tried to patch this replacement in color.c and graphics.c, it works fine. Constructions with ERROR_NOTICE are found also in gplt_x11.c. It seems to me that they serve for reporting problems with ipc communication, so they should "never" happen. The int_warn() construct cannot be used in gplt_x11. The (interactive) mode is off also for the load command, where the messages can be useful. Well, I came to this problem when testing the "dumb" terminal from within Octave (ssh without x11). Then every plot was entitled Error: terminal "dumb" does not support continuous colors. I want to get rid of that annoying message in this terminal - the dumb terminal is too dumb for this message :-) Thus I propose to add if (strcmp(term->name,"dumb")) before these warnings in graphics.c: int_warn "terminal ... does not support continuous colors.",term->name; int_warn "terminal ... does not support palette-based images.",term->name; int_warn "terminal ... does not support rgb images.",term->name; Further, there is: int_error(NO_CARET, "This terminal does not support filled polygons"); I think that this should be changed to int_warn "terminal ... does not support filled polygons.",term->name; with the same if ("dumb"). All other screen/interactive terminals implement all of these functions so the message never appears for them. > Or maybe we could add a command line option > gnuplot -nowarnings > and/or an internal command > unset warnings Yes, this may be interesting. There are indeed languages where you can set warnings on and off. --- PM |