changeset 32109:40b7b2316d2d

type.m: Identify file type correctly (bug #64286) * type.m: Replace hard-coded "user-defined function" with call to `__which__`.
author Arun Giridhar <arungiridhar@gmail.com>
date Sat, 10 Jun 2023 08:38:17 -0400
parents d806017abdcb
children 7b29c030493d
files scripts/help/type.m
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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");