Mercurial > hg > octave-lojdl
changeset 5738:126d7f1945ee
[project @ 2006-04-05 03:04:08 by jwe]
author | jwe |
---|---|
date | Wed, 05 Apr 2006 03:04:08 +0000 |
parents | c70bfdf5b2c5 |
children | d090d39bb82c |
files | src/ChangeLog src/help.cc |
diffstat | 2 files changed, 18 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-04-04 David Bateman <dbateman@free.fr> + + * help.cc (Flookfor): Skip overloaded functions. Lookup help text + of autoloaded function, not parent that contains the autoload. + 2006-04-03 David Bateman <dbateman@free.fr> * data.cc (Fresize): New function.
--- a/src/help.cc +++ b/src/help.cc @@ -1123,6 +1123,8 @@ std::string first_help_sentence (const std::string& h, bool short_sentence = true) { + std::string retval; + size_t pos = 0; if (looks_like_texinfo (h, pos)) @@ -1155,7 +1157,7 @@ } if (pos == NPOS) - return std::string (); + return retval; // At start of real text. Get first line with the sentence size_t new_pos = h2.find_first_of ('\n', pos); @@ -1189,9 +1191,9 @@ } if (dot_pos == NPOS) - return line; + retval = line; else - return line.substr (0, dot_pos + 1); + retval = line.substr (0, dot_pos + 1); } else { @@ -1390,7 +1392,7 @@ } if (pos == NPOS) - return std::string (); + return retval; // At start of real text. Get first line with the sentence size_t new_pos = h.find_first_of ('\n', pos); @@ -1425,10 +1427,12 @@ } if (dot_pos == NPOS) - return line; + retval = line; else - return line.substr (0, dot_pos + 1); + retval = line.substr (0, dot_pos + 1); } + + return retval; } static void @@ -1651,7 +1655,8 @@ OCTAVE_QUIT; symbol_record *sr = lookup_by_name (name, 0); - if (sr && sr->is_defined ()) + if (sr && sr->is_defined () + && sr->type_name () != "overloaded function") { std::string h = sr->help (); @@ -1794,7 +1799,7 @@ if (!sr) { // Must load to get help - sr = lookup_by_name (name, false); + sr = lookup_by_name (aname, false); std::string h; if (sr && sr->is_defined ())