# HG changeset patch # User Pantxo Diribarne # Date 1509451321 -3600 # Node ID 7a2cecc1ec24fd26473d77e0e066b49d3ee9df0f # Parent 1253132e2173be563f09d4751f03c69315daaa6c edit.m: use the bare name for header and function prototype (bug #52316) * edit.m: use the bare name in auto generated prototype. Remove trailing white space after "-*- texinfo -*-" in m files function prototype diff -r 1253132e2173 -r 7a2cecc1ec24 scripts/miscellaneous/edit.m --- a/scripts/miscellaneous/edit.m Mon Oct 30 21:22:15 2017 -0700 +++ b/scripts/miscellaneous/edit.m Tue Oct 31 13:02:01 2017 +0100 @@ -459,6 +459,7 @@ endswitch ## Generate the function template. + [~, basename] = fileparts (name); exists = exist (name); switch (ext) case {"cc", "C", "cpp"} @@ -474,9 +475,9 @@ code = " "; endif body = ["#include \n\n" ... - "DEFUN_DLD(" name ", args, nargout,\n" ... + "DEFUN_DLD(" basename ", args, nargout,\n"... " \"-*- texinfo -*-\\n\\\n" ... - "@deftypefn {} {@var{retval} =} " name ... + "@deftypefn {} {@var{retval} =} " basename... " (@var{input1}, @var{input2})\\n\\\n" ... "@seealso{}\\n\\\n@end deftypefn\")\n{\n" ... " octave_value_list retval;\n" ... @@ -489,19 +490,19 @@ if (any (exists == [2, 103])) body = type (name){1}; else - body = ["function [retval] = " name " (input1, input2)\n\n" ... + body = ["function [retval] = " basename " (input1, input2)\n\n" ... "endfunction\n"]; endif if (isempty (head)) - comment = ["## -*- texinfo -*- \n## @deftypefn {} " ... - "{@var{retval} =} " name ... + comment = ["## -*- texinfo -*-\n## @deftypefn {} " ... + "{@var{retval} =} " basename ... " (@var{input1}, @var{input2})\n##\n" ... "## @seealso{}\n## @end deftypefn\n\n" ... "## " strrep(tail, "\n", "\n## ") "\n\n"]; else comment = ["## " strrep(head,"\n","\n## ") "\n\n" ... "## -*- texinfo -*- \n## @deftypefn {} " ... - "{@var{retval} =} " name ... + "{@var{retval} =} " basename ... " (@var{input1}, @var{input2})\n##\n" ... "## @seealso{}\n## @end deftypefn\n\n" ... "## " strrep(tail, "\n", "\n## ") "\n\n"];