help directory_name

View: New views
2 Messages — Rating Filter:   Alert me  

help directory_name

by Marco Caliari-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear maintainers,

if your current working directory is, e.g., /home/caliari/analysis and you
type

help analysis

you should get the help text for Contents.m (if present). This does not
work in Octave 3.2.3

octave:1> help analysis
error: help: `analysis' not found
octave:1> pwd
ans = /home/caliari/analysis
octave:2> ls
Contents.m

despite the function do_contents in help.m. It is not difficult to fix
this problem. But, there is another problem: if you type

help name

in Matlab, and name is more than once in your path, then you get the
help text for all the Contents.m therein. In Octave there is
find_dir_in_path. First of all, it does not find name in the current
working directory:

octave:1> pwd
ans = /home/caliari/analysis
octave:2> path

Octave's search path contains the following directories:

.
/usr/local/share/octave/3.2.3/m/statistics/base
[CUT...]
octave:3> find_dir_in_path ('analysis')
ans =

and, if name is twice in your path, it finds only one

octave:1> find_dir_in_path('geometry')
ans = /usr/local/share/octave/3.2.3/m/geometry
octave:2> addpath('/home/caliari/geometry')
octave:3> find_dir_in_path('geometry')
ans = /home/caliari/geometry

I think that the right fix for help directory_name should be based on a
fix for find_dir_in_path (which I'm not able to do).

Best regards,

Marco

help directory_name

by John W. Eaton-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 29-Oct-2009, Marco Caliari wrote:

| Dear maintainers,
|
| if your current working directory is, e.g., /home/caliari/analysis and you
| type
|
| help analysis
|
| you should get the help text for Contents.m (if present). This does not
| work in Octave 3.2.3
|
| octave:1> help analysis
| error: help: `analysis' not found
| octave:1> pwd
| ans = /home/caliari/analysis
| octave:2> ls
| Contents.m
|
| despite the function do_contents in help.m. It is not difficult to fix
| this problem. But, there is another problem: if you type
|
| help name
|
| in Matlab, and name is more than once in your path, then you get the
| help text for all the Contents.m therein. In Octave there is
| find_dir_in_path. First of all, it does not find name in the current
| working directory:
|
| octave:1> pwd
| ans = /home/caliari/analysis
| octave:2> path
|
| Octave's search path contains the following directories:
|
| .
| /usr/local/share/octave/3.2.3/m/statistics/base
| [CUT...]
| octave:3> find_dir_in_path ('analysis')
| ans =
|
| and, if name is twice in your path, it finds only one
|
| octave:1> find_dir_in_path('geometry')
| ans = /usr/local/share/octave/3.2.3/m/geometry
| octave:2> addpath('/home/caliari/geometry')
| octave:3> find_dir_in_path('geometry')
| ans = /home/caliari/geometry
|
| I think that the right fix for help directory_name should be based on a
| fix for find_dir_in_path (which I'm not able to do).

I checked in the following changeset.

  http://hg.savannah.gnu.org/hgweb/octave/rev/8e345f2fe4d6

jwe