# HG changeset patch # User Arun Giridhar # Date 1686400697 14400 # Node ID 40b7b2316d2deb716bc49d5cff236dce923ec544 # Parent d806017abdcb33443a5d99bac4288e5734f602e5 type.m: Identify file type correctly (bug #64286) * type.m: Replace hard-coded "user-defined function" with call to `__which__`. diff -r d806017abdcb -r 40b7b2316d2d scripts/help/type.m --- a/scripts/help/type.m Fri Jun 09 19:57:20 2023 -0700 +++ b/scripts/help/type.m Sat Jun 10 08:38:17 2023 -0400 @@ -97,8 +97,9 @@ if (quiet) txt = contents; else - txt = sprintf ("%s is the user-defined function defined from: %s\n\n%s", - name, file, contents); + tmp = __which__ (name); + txt = sprintf ("%s is the %s defined from: %s\n\n%s", + name, tmp.type, file, contents); endif elseif (e == 3) txt = sprintf ("%s is a dynamically-linked function", name); @@ -144,7 +145,7 @@ %!test %! txt = type ("ls"); %! typestr = txt{1}(1:31); -%! assert (typestr, "ls is the user-defined function"); +%! assert (typestr, "ls is the function defined from"); %!test %! txt = type ("ls", "-q");