Doug Stewart wrote:
> Please bear with me. I am learning how to use mercurial system and diff.
>
> I am running Ubuntu and installed mercurial system and then cloned Octave
> So I am sure that I have the latest version of grid.m
>
> I then made my changes and did a diff  --- see below:
>
> The changes are needed because the minor grid did not work
> grid("minor","on") did not work because nargs was restricted to 1.
>
> If I have done something  wrong then let me know and I will try and do 
> better.
>
> Doug Stewart
>
>
> here is my diff command
>
> [EMAIL PROTECTED]:~/octave$ diff -iw  grid.m grid1.m
>
>
> 34a35
>  > ## Revised by: Doug Stewart, Dec. 2008
> 45c46
> <   if (nargs > 1)
> ---
>  >   if (nargs > 2)
> 57,58c58,61
> <     minor_on = ! minor_on;
> <     if (minor_on)
> ---
>  >         if (nargs==2)
>  >       x2=varargin{2};
>  >       if (strcmpi (x2, "on"))
>  >         minor_on = true;
> 59a63,72
>  >         elseif(strcmpi (x2, "off"))
>  >           minor_on = false;
>  >                     else
>  >           print_usage ();
>  >       endif
>  >     else
>  >        minor_on = ! minor_on
>  >        if (minor_on)
>  >          grid_on = true
>  >        endif
>
>
>
>   


I now learned some more:-)

[EMAIL PROTECTED]:~/octave1$ hg diff
diff -r 6e9660cd3bf2 scripts/plot/grid.m
--- a/scripts/plot/grid.m    Tue Dec 09 03:25:31 2008 +0100
+++ b/scripts/plot/grid.m    Mon Dec 08 22:51:38 2008 -0500
@@ -32,6 +32,7 @@
 ## @end deftypefn
 
 ## Author: jwe
+## Revised by: Doug Stewart, Dec. 2008
 
 ## PKG_ADD: mark_as_command grid
 
@@ -42,7 +43,7 @@ function grid (varargin)
 
   [ax, varargin, nargs] = __plt_get_axis_arg__ ("grid", varargin{:});
 
-  if (nargs > 1)
+  if (nargs > 2)
     print_usage ();
   elseif (nargs == 0)
     grid_on = ! grid_on;
@@ -54,9 +55,21 @@ function grid (varargin)
       elseif (strcmpi (x, "on"))
     grid_on = true;
       elseif (strcmpi (x, "minor"))
-    minor_on = ! minor_on;
-    if (minor_on)
-      grid_on = true;
+        if (nargs==2)
+      x2=varargin{2};
+      if (strcmpi (x2, "on"))
+        minor_on = true;
+        grid_on=true;
+        elseif(strcmpi (x2, "off"))
+          minor_on = false;
+       else
+          print_usage ();
+      endif
+    else
+       minor_on = ! minor_on
+       if (minor_on)
+         grid_on = true;
+       endif
     endif
       else
     print_usage ();


Is this way better?
Doug

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to