# HG changeset patch # User jwe # Date 1144206248 0 # Node ID 126d7f1945eee386adaa592b46a75e3ebf91a1e9 # Parent c70bfdf5b2c569156c369558194c97c0b20e23c8 [project @ 2006-04-05 03:04:08 by jwe] diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-04-04 David Bateman + + * help.cc (Flookfor): Skip overloaded functions. Lookup help text + of autoloaded function, not parent that contains the autoload. + 2006-04-03 David Bateman * data.cc (Fresize): New function. diff --git a/src/help.cc b/src/help.cc --- 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 ())