changeset 7438:6873fe003323

[project @ 2008-02-02 06:48:47 by jwe]
author jwe
date Sat, 02 Feb 2008 06:48:47 +0000
parents 3e450caf93f2
children 1867156fc552
files src/ChangeLog src/help.cc src/ov-fcn.h
diffstat 3 files changed, 36 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2008-02-02  John W. Eaton  <jwe@octave.org>
+
+	* help.cc (do_type): Don't print dyamically loaded function files.
+
+	* ov-fcn.h (octave_function::is_dynamically_loaded_function): Delete.
+
 2008-02-01  John W. Eaton  <jwe@octave.org>
 
 	* symtab.cc (Fset_variable, Fvariable_value):
--- a/src/help.cc
+++ b/src/help.cc
@@ -1144,8 +1144,8 @@
   if (fs)
     {
       if (pr_type_info && ! quiet)
-	os << name << " is the " << type
-		   << " defined from: " << fname << "\n\n";
+	os << name << " is the " << type << " defined from the file\n"
+	   << fname << ":\n\n";
 
       char ch;
 
@@ -1183,23 +1183,38 @@
 	{
 	  octave_function *fcn = val.function_value ();
 
-	  std::string fn = fcn ? fcn->fcn_file_name () : std::string ();
+	  if (fcn)
+	    {
+	      std::string fn = fcn->fcn_file_name ();
 
-	  if (pr_orig_txt && ! fn.empty ())
-	    display_file (os, name, fn, "function", pr_type_info, quiet);
-	  else
-	    {
-	      if (pr_type_info && ! quiet)
+	      if (fcn->is_builtin_function ())
+		os << name << " is a built-in function" << std::endl;
+	      else if (fcn->is_dld_function () || fcn->is_mex_function ())
+		os << name
+		   << " is a dyanmically loaded function from the file\n"
+		   << fn << std::endl;
+	      else if (pr_orig_txt && ! fn.empty ())
+		display_file (os, name, fn, "function", pr_type_info, quiet);
+	      else
 		{
-		  std::string type
-		    = fcn->is_user_function () ? "command-line" : "built-in";
+		  if (pr_type_info && ! quiet)
+		    {
+		      os << name;
 
-		  os << name << " is a " << type << " function:\n\n";
+		      if (fcn->is_user_function ())
+			{
+			  if (fn.empty ())
+			    os << " is a command-line function:\n\n";
+			  else
+			    os << " is a function defined from the file\n"
+			       << fn << ":\n\n";
+			}
+		    }
+
+		  tree_print_code tpc (os, "", pr_orig_txt);
+
+		  fcn->accept (tpc);
 		}
-
-	      tree_print_code tpc (os, "", pr_orig_txt);
-
-	      fcn->accept (tpc);
 	    }
 	}
       else
--- a/src/ov-fcn.h
+++ b/src/ov-fcn.h
@@ -56,8 +56,6 @@
 
   bool is_function (void) const { return true; }
 
-  virtual bool is_dynamically_loaded_function (void) const { return false; }
-
   virtual bool is_system_fcn_file (void) const { return false; }
 
   virtual std::string fcn_file_name (void) const { return std::string (); }