diff scripts/help/lookfor.m @ 8941:b8ed0262b11e

lookfor.m: also match function names
author John W. Eaton <jwe@octave.org>
date Mon, 09 Mar 2009 14:52:59 -0400
parents 6994961bf1f4
children 57649dcecb55
line wrap: on
line diff
--- a/scripts/help/lookfor.m	Mon Mar 09 14:31:10 2009 -0400
+++ b/scripts/help/lookfor.m	Mon Mar 09 14:52:59 2009 -0400
@@ -173,13 +173,13 @@
 
 function [funs, help_texts] = search_cache (str, cache_file, search_type)
   load (cache_file);
-  if (! isempty(cache))
-    tmp = strfind (cache (search_type, :), str);
-    cache_idx = find (!cellfun ("isempty", tmp));
+  if (! isempty (cache))
+    t1 = strfind (cache (1, :), str);
+    t2 = strfind (cache (search_type, :), str);
+    cache_idx = find (! (cellfun ("isempty", t1) & cellfun ("isempty", t2)));
     funs = cache (1, cache_idx);
     help_texts = cache (3, cache_idx);
   else
     funs = help_texts = {};
   endif
 endfunction
-