Dear Torsten,

thanks a lot for your feedback!

[...]As as idea, you might consider installing this functor as an executable with ozmake, then the user only needs to make sure that such executables are in the PATH.

Good idea. I will look into this.

However, it appears that ozfind is not reading me OZRC. Any idea?

Not sure. It seems to work for me.
You could try to execute the attached file in the OPI (with the last line adjusted) and see what it does, maybe with the debugger attached. On the other hand, this is just the standard OZRC-loading code. So the problem lies probably somewhere else. You could also try to compile ProcedureFinder.oz with debugging information and modify oz-find-procedure to call the Oz debugger:

;;    (call-process "ozengine" nil t nil "~/ProcedureFinder.ozf"
   (call-process "ozd" nil t nil "~/ProcedureFinder.ozf" "--"

(Note the extra "--" argument.)
However, I could not figure out how to make ozd use another Emacs instance to show the source code.

[...]

I tried installing Emacs-w3m, but due to its dependencies (e.g., gc.h) I better postpone that :)

BTW, there is some browser control contribution in Mogul. It needs updating, but this idea is rather simple. Below is the idea in a nutshell, this is a copy from the Mogul contribution with a little edit I did years ago. I never tried the Windows line, "open" always works nice on a Mac, but the naive default approach tries to open a new Firefox instance all the time. There is certainly some way around that...
[...]
There is also Emacs' "browse-url" function.
It should work if you change oz-find-procedure like this:

       ;; show documentation
       (let ((sf (substring (thing-at-point 'line) 0 -1)))
         (kill-buffer nil)
         (browse-url fn)  ;; NEW LINE
;;(w3m-find-file (if (string= fn "self") filename fn)) ;; OUT-COMMENTED
         ;;(re-search-forward sf)  ;; OUT-COMMENTED
         (if open-new-window
(select-window sw) ) )

However, the browser will not jump to the right position within the document if you use this approach.

Cheers,
 Wolfgang




On Mar 27, 2008, at 8:09 PM, Wolfgang Meyer wrote:
Dear Torsten,

I'm sorry that ozfind does not (yet) work on your system.
I hope I didn't accidentally introduce a local dependency or something
similar...

If Emacs ends up in dir mode, this usually means that
"ProcedureFinder.ozf" crashed early with an exception. This exception is
written into a temporary Emacs buffer.
Usually this buffer is closed after execution. To  make sure that we can
see the exception, please change the Lisp function oz-find-procedure in
".emacs" like this:

      ;; show source code
      (let ((cl (string-to-number (thing-at-point 'line))))
        (forward-line)
        (let ((cc (string-to-number (thing-at-point 'line))))
          ;; (kill-buffer nil)          ;; OUT-COMMENT THIS LINE
          (if (string= fn "self")
          (switch-to-buffer cb)
        (find-file fn)
        )

Re-evaluate oz-find-procedure or restart Emacs.
Now try to use ozfind.
Afterwards look at the contents of the buffer "*TEMP*" (or "*TEMP*<X>").

Cheers,
  Wolfgang


Torsten Anders wrote:
Dear Wolfgang,

thanks for your tool and sorry for my late reply.

Unfortunately, I was not able to install ozfind successfully.
Regardless of what I ask from ozfind, it appears that I always end up
in dir mode (which -- you told before -- means that ozfind crashed). I
tried both with and without setting the args --mozart-sources etc, I
tried removing my OZRC, and I tried removing my arg --linkPattern --
still, no success.

Is there a way to enable debugging information, so I could give you a
more informative error description?

Thank you!

Best
Torsten

PS: I am using your latest version (just downloaded ozfind 0.1),
Mozart Compiler 1.3.99 (20070703), and
Aquamacs Distribution 1.3a, which is based GNU Emacs 22.1.91.2 -- all
running on MacOS 10.4.10.


On Mar 17, 2008, at 9:53 PM, Wolfgang Meyer wrote:
Dear all,

I finished a new version of my code navigation tool, which from now on
is called "ozfind".

ozfind is a source code navigation tool and documentation finder for
Mozart/Oz, integrated into GNU Emacs.

Besides a number of bug fixes, it contains two new important features:
- It is now possible to navigate to the source code of methods (with
some limitations).
- You can now look up the documentation of system functions directly in
Emacs (with Emacs-w3m installed).

Download: http://code.google.com/p/oz-code/

README: http://ozfind.jottit.com/

Cheers,
  Wolfgang

_________________________________________________________________________________


--
Torsten Anders
Interdisciplinary Centre for Computer Music Research
University of Plymouth
Office: +44-1752-233667
Private: +44-1752-558917
http://strasheela.sourceforge.net
http://www.torsten-anders.de

declare
fun {FileExists FileName}
   try F in
      F = {New Open.file init(name: FileName flags: [read])}
      {F close()}
      true
   catch _ then false
   end
end

local
   OPICompiler = {New Compiler.engine init}
in
   %% add the full OPI environment
   {OPICompiler enqueue(mergeEnv(OPIEnv.full))}
   %% feed code in OZRC (OPI user configuration) (from OPI.oz)
   case {OS.getEnv 'HOME'} of false then skip
   elseof HOME then
      OZRC = {OS.getEnv 'OZRC'}
   in
      if OZRC \= false andthen {FileExists OZRC} then
         {System.showInfo "enquing "#OZRC}
         {OPICompiler enqueue(feedFile(OZRC))}
      elseif {FileExists {Property.get 'oz.dotoz'}#'/ozrc'} then
         {System.showInfo "enquing "#{Property.get 'oz.dotoz'}#'/ozrc'}
         {OPICompiler enqueue(feedFile({Property.get 'oz.dotoz'}#'/ozrc'))}
      elseif {FileExists HOME#'/.oz/ozrc'} then
         {System.showInfo "enquing "#HOME#'/.oz/ozrc'}
         {OPICompiler enqueue(feedFile(HOME#'/.oz/ozrc'))}
      elseif {FileExists HOME#'/.ozrc'} then   % note: deprecated
         {System.showInfo "enquing "#HOME#'/.ozrc'}
         {OPICompiler enqueue(feedFile(HOME#'/.ozrc'))}
      end
   end
   
   FullEnvironment = {OPICompiler enqueue(getEnv($))}
end
in
{System.show {CondSelect FullEnvironment 'Some Identifier From Your OZRC File' 
false}}
_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to