annotate scripts/plot/gnuplot_drawnow.m @ 7408:246f905cb984

[project @ 2008-01-22 19:42:47 by jwe]
author jwe
date Tue, 22 Jan 2008 19:42:48 +0000
parents
children a0ec02774303
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7408
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
1 ## Copyright (C) 2005, 2006, 2007 John W. Eaton
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
2 ##
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
3 ## This file is part of Octave.
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
4 ##
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
8 ## your option) any later version.
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
9 ##
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
13 ## General Public License for more details.
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
14 ##
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
17 ## <http://www.gnu.org/licenses/>.
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
18
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
19 ## -*- texinfo -*-
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
20 ## @deftypefn {Function File} {} drawnow ()
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
21 ## Update and display the current graphics.
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
22 ##
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
23 ## Octave automatically calls drawnow just before printing a prompt,
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
24 ## when @code{sleep} or @code{pause} is called, or while waiting for
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
25 ## command-line input.
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
26 ## @end deftypefn
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
27
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
28 ## Author: jwe
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
29
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
30 function gnuplot_drawnow (h, term, file, mono, debug_file)
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
31
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
32 if (nargin < 4)
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
33 mono = false;
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
34 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
35
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
36 if (nargin >= 3 && nargin <= 5)
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
37 f = __get__ (h);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
38 plot_stream = [];
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
39 fid = [];
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
40 unwind_protect
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
41 [plot_stream, enhanced] = open_gnuplot_stream ([], term, file);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
42 __go_draw_figure__ (f, plot_stream, enhanced, mono);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
43 if (nargin == 5)
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
44 fid = fopen (debug_file, "wb");
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
45 enhanced = init_plot_stream (fid, [], term, file);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
46 __go_draw_figure__ (f, fid, enhanced, mono);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
47 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
48 unwind_protect_cleanup
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
49 if (! isempty (plot_stream))
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
50 pclose (plot_stream);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
51 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
52 if (! isempty (fid))
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
53 fclose (fid);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
54 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
55 end_unwind_protect
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
56 elseif (nargin == 1)
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
57 f = __get__ (h);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
58 plot_stream = f.__plot_stream__;
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
59 if (isempty (plot_stream))
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
60 [plot_stream, enhanced] = open_gnuplot_stream (h);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
61 set (h, "__enhanced__", enhanced);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
62 else
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
63 enhanced = f.__enhanced__;
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
64 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
65 __go_draw_figure__ (f, plot_stream, enhanced, mono);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
66 else
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
67 print_usage ();
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
68 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
69
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
70 endfunction
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
71
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
72 function [plot_stream, enhanced] = open_gnuplot_stream (h, varargin)
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
73
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
74 cmd = gnuplot_binary ();
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
75
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
76 plot_stream = popen (cmd, "w");
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
77
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
78 if (plot_stream < 0)
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
79 error ("drawnow: failed to open connection to gnuplot");
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
80 else
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
81
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
82 if (! isempty (h))
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
83 set (h, "__plot_stream__", plot_stream);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
84 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
85
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
86 enhanced = init_plot_stream (plot_stream, h, varargin{:});
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
87
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
88 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
89
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
90 endfunction
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
91
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
92 function enhanced = init_plot_stream (plot_stream, h, term, file)
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
93
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
94 if (nargin == 4)
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
95 enhanced = enhanced_term (term);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
96 if (! isempty (term))
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
97 if (enhanced)
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
98 fprintf (plot_stream, "set terminal %s enhanced;\n", term);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
99 else
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
100 fprintf (plot_stream, "set terminal %s;\n", term);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
101 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
102 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
103 if (! isempty (file))
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
104 fprintf (plot_stream, "set output \"%s\";\n", file);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
105 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
106 else
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
107
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
108 ## Guess the terminal type.
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
109 term = getenv ("GNUTERM");
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
110 if (isempty (term))
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
111 if (! isempty (getenv ("DISPLAY")))
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
112 term = "x11";
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
113 elseif (! isunix ())
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
114 term = "windows";
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
115 else
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
116 ## This should really be checking for os x before setting
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
117 ## the terminal type to aqua, but nobody will notice because
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
118 ## every other unix will be using x11 and windows will be
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
119 ## using windows. Those diehards still running octave from
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
120 ## a linux console know how to set the GNUTERM variable.
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
121 term = "aqua";
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
122 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
123 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
124
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
125 enhanced = enhanced_term (term);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
126 if (enhanced)
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
127 enh_str = "enhanced";
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
128 else
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
129 enh_str = "";
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
130 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
131
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
132 ## If no 'h' (why not?) then open the terminal as Figure 0.
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
133 if (isempty (h))
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
134 h = 0;
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
135 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
136
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
137 if (strcmp (term, "x11"))
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
138 fprintf (plot_stream, "set terminal x11 %s title \"Figure %d\"\n",
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
139 enh_str, h);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
140 elseif (strcmp (term, "aqua"))
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
141 ## Aqua doesn't understand the 'title' option despite what the
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
142 ## gnuplot 4.2 documentation says.
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
143 fprintf (plot_stream, "set terminal aqua %d %s\n", h, enh_str);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
144 elseif (strcmp (term, "wxt"))
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
145 fprintf (plot_stream, "set terminal wxt %s title \"Figure %d\"\n",
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
146 enh_str, h);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
147
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
148 elseif (enhanced)
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
149 fprintf (plot_stream, "set terminal %s %s\n", term, enh_str);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
150 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
151 ## gnuplot will pick up the GNUTERM environment variable itself
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
152 ## so no need to set the terminal type if not also setting the
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
153 ## figure title or enhanced mode.
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
154
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
155 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
156
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
157 endfunction
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
158
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
159 function have_enhanced = enhanced_term (term)
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
160 persistent enhanced_terminals;
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
161
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
162 if (isempty (enhanced_terminals))
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
163 ## Don't include pstex, pslatex or epslatex here as the TeX commands
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
164 ## should not be interpreted in that case.
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
165 if (compare_versions (__gnuplot_version__ (), "4.0", ">"))
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
166 enhanced_terminals = {"aqua", "dumb", "png", "jpeg", "gif", "pm", ...
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
167 "windows", "wxt", "svg", "postscript", "x11", "pdf"};
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
168 else
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
169 enhanced_terminals = {"x11", "postscript"};
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
170 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
171 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
172
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
173 term = tolower (term);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
174
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
175 have_enhanced = false;
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
176 for i = 1 : length (enhanced_terminals)
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
177 t = enhanced_terminals{i};
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
178 if (strncmp (term, t, min (length (term), length (t))))
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
179 have_enhanced = true;
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
180 break;
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
181 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
182 endfor
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
183 endfunction