From sources-request at octave dot org Tue Oct 12 12:48:07 2004 Subject: whos From: =?iso-8859-1?q?=D8yvind_Kristiansen?= To: sources at octave dot org Date: Tue, 12 Oct 2004 19:46:05 +0200 --Boundary-00=_dhBbBepa738T1Q5 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi! There seems to be a problem with the output from "whos". Some parts of the formatting sequence in "whos_line_format" are currently not used, like the size_of_parameter and center-specific. As a consequence of this, it is difficult to add space between the columns in a nice way. I think this patch will fix the problem. Cheers, Oeyvind oyvindk at q-free dot com (/oyvinkri@stud.ntnu.no) --Boundary-00=_dhBbBepa738T1Q5 Content-Type: text/x-diff; charset="us-ascii"; name="patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch" Index: symtab.cc =================================================================== RCS file: /cvs/octave/src/symtab.cc,v retrieving revision 1.106 diff -c -p -r1.106 symtab.cc *** a/symtab.cc 22 Sep 2004 02:50:36 -0000 1.106 --- b/symtab.cc 12 Oct 2004 17:42:41 -0000 *************** symbol_table::parse_whos_line_format (Ar *** 1427,1432 **** --- 1427,1439 ---- param.parameter_length = param_length(pos); param.text = param_names(pos); param.line.assign (param_names (pos).length (), '='); + + param.parameter_length = (a > param.parameter_length ? + a : param.parameter_length); + if((param.command == 's') && (param.modifier == 'c') && (b > 0)) + { + param.first_parameter_length = b; + } } else { *************** symbol_table::parse_whos_line_format (Ar *** 1441,1448 **** // Space needed for Size column is hard to determine in prior, // because it depends on dimensions to be shown. That is why it is // recalculated for each Size-command ! int j, first = 0, rest = 0, total = 0; param.dimensions = c; for (j = 0; j < len; j++) { --- 1448,1457 ---- // Space needed for Size column is hard to determine in prior, // because it depends on dimensions to be shown. That is why it is // recalculated for each Size-command ! int j, first, rest = 0, total; param.dimensions = c; + first = param.first_parameter_length; + total = param.parameter_length; for (j = 0; j < len; j++) { --Boundary-00=_dhBbBepa738T1Q5--