From bug-request at octave dot org Fri Apr 14 13:00:24 2006 Subject: Re: addpath, rmpath, savepath From: "Robert S. Weigel" To: bug at octave dot org Cc: "John W. Eaton" Date: Fri, 14 Apr 2006 13:59:05 -0400 --Boundary_(ID_PuiWuPXeDA1xHKbY80St5w) Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT Content-disposition: inline On Friday 14 April 2006 12:37, John W. Eaton wrote: > On 11-Apr-2006, Robert S. Weigel wrote: > | I was not able to make simple changes to the existing addpath/rmpath > | files because there were other major differences besides the ones I > | described in my first email. For example, > | As you will see from the demo, the current addpath and rmpath do > | unexpected things besides allowing '.' to be removed or not be first. > | xaddpath and xrmpath allow strange things too (most are listed in the > | help). Note that xaddpath and xrmpath both generate a warning because > | they set DEFAULT_LOADPATH to ''. > If you would like to get changes accepted, then please send context > diffs relative to the version you started with. Please do follow the > I'm not sure what the best thing is to do with DEFAULT_LOADPATH, but I > don't think that you should set it to the empty string. Probably it > should not be modified at all. Given the number of things that would need to be changed simultaneously for Matlab compatability I think it is best to leave things as they are. Both the Matlab compatable and existing functions do unexpected things, and I don't have a strong reason to prefer Matlab compatability over backward compatability for users of the addpath/rmpath functions that were previously in octave-forge. I can only suggest that it may help users if a note is added to the help of addpath and rmpath. For what it is worth, diffs for this are attached. Bob --Boundary_(ID_PuiWuPXeDA1xHKbY80St5w) Content-type: text/x-diff; charset=us-ascii; name=addpath.diff Content-transfer-encoding: 7BIT Content-disposition: attachment; filename=addpath.diff Index: addpath.m =================================================================== RCS file: /cvs/octave/scripts/path/addpath.m,v retrieving revision 1.3 diff -u -r1.3 addpath.m --- addpath.m 4 Apr 2006 19:41:45 -0000 1.3 +++ addpath.m 14 Apr 2006 17:40:22 -0000 at @ -30,6 +30,9 @@ ## An error will be returned if the string is not a directory, the ## directory doesn't exist or you don't have read access to it. ## +## Caution: When you add a path, the current directory gets pushed +## down in the search list. +## ## BUG: This function can't add directories called at samp{-end} or ## at samp{-begin} (case insensitively). ## --Boundary_(ID_PuiWuPXeDA1xHKbY80St5w) Content-type: text/x-diff; charset=us-ascii; name=rmpath.diff Content-transfer-encoding: 7BIT Content-disposition: attachment; filename=rmpath.diff Index: rmpath.m =================================================================== RCS file: /cvs/octave/scripts/path/rmpath.m,v retrieving revision 1.3 diff -u -r1.3 rmpath.m --- rmpath.m 4 Apr 2006 19:41:45 -0000 1.3 +++ rmpath.m 14 Apr 2006 17:40:43 -0000 at @ -18,6 +18,8 @@ ## at deftypefn {Function File} {} rmpath (@var{dir1}, @dots{}) ## Remove at var{dir1}, @dots{} from the current @code{LOADPATH}. ## +## Caution: /path and /path/ are treated as different directory names. +## ## at seealso{LOADPATH, addpath, savepath, setpath} ## at end deftypefn --Boundary_(ID_PuiWuPXeDA1xHKbY80St5w)-- ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------