Hello Paul,

I submit you another solution to this problem. Bellow is my rewriting of
the jde-help-get-javadoc function which try now to find automatically the
javadoc file in its version 2 form, then in its version 1 form, and returns
the first one found or nil if the file does not exists. In this way it is
unnecessery to change the jde-help-javadoc-dirs customization.

(defun jde-help-get-javadoc (class)
  "Gets path to the javadoc file for CLASS where CLASS is a
qualified class name."
  (if class
      (let ((doc-subpath                ; Java version 2 form
             (concat (substitute ?/ ?. class) ".html"))
            (doc-subpath-1              ; Java version 1 form
             (concat class ".html")))
        (cond
         ((not jde-help-javadoc-dirs)
          (error "%s" "Help error: jde-help-javadoc-dirs is nil."))
         ((not (listp jde-help-javadoc-dirs))
          (error "%s" "Help error: jde-help-javadoc-dirs is not a list."))
         (t
          (let ((paths
                 (mapcar
                  (lambda (doc-dir)
                    (let* ((doc-dir
                            (if (let ((last-char (aref doc-dir (- (length
doc-dir) 1))))
                                  (or (equal last-char ?/)
                                      (equal last-char ?\))))
                                doc-dir
                             (concat doc-dir "/")))
                           (class-doc-path (concat doc-dir doc-subpath))
                           (class-doc-path-1 (concat doc-dir
doc-subpath-1)))
                      (if (file-exists-p class-doc-path)
                          class-doc-path
                        (if (file-exists-p class-doc-path-1)
                            class-doc-path-1))))
                  jde-help-javadoc-dirs)))
            (setq paths (delq nil paths))
            ;; Return first file found.
            (if paths (car paths) paths)))))))

Hope this will help.

Sincerely,
David





Paul Kinnucan <[EMAIL PROTECTED]> on 06/24/99 15:50:56

Pour :    [EMAIL PROTECTED]
cc :  [EMAIL PROTECTED] (ccc : David PONCE/FR/Schneider)
Objet :   Re: JDE 2.1.6beta3 Release[problems]




At 09:14 AM 6/24/99 -0400, Brad Giaccio wrote:
>On Thu, Jun 24, 1999 at 08:45:08AM -0400, Paul Kinnucan wrote:
>> >
>> >BeanShell 0.96 beta - by Pat Niemeyer ([EMAIL PROTECTED])
>> >(list "java.lang.System")
>> >bsh %
>> >
>>
>> Interactions between internal JDE code and the BeanShell do not appear
>> in the bsh window.
>>
>
>Then I guess I see the ouput because jde has already given up by the
>time bsh starts.
>
>> 1)  .emacs file
>attached
>
>>
>> 2)  Version of the JDK you are using.
>>
>jdk 1.1.6 and/or 1.1.8

As another user pointed out, the beta version of jde-help-class does not
work with JDK 1.1.x javadoc because the command assumes the JDK 1.2 javadoc
structure (e.g., the doc directory mirrors the package directory) and JDK
1.1.x doc uses instead a flat file structure with the package qualifier
prepended to the class name, e.g., java.awt.String.html. I plan to fix this
problem shortly so that the help command will work with both types of
javadoc organization. My plan is to change the doc directories variable to
look something like this in the customization buffer:

jde-help-javadoc-dirs
  Doc path: d:/jdk/docs
  Javadoc version: [  ] JDK 1.1
                          [X] JDK 1.2
  Doc path: d:/myproj/docs
  Javadoc version: [X] JDK 1.1
                          [  ]  JDK 1.2
etc.

In other works, for each doc directory, you can specify the version of the
javadoc tool that generated it. The jde-help-class command will then do the
right thing based on the type of javadoc it expects to find in the
directory.

- Paul

- Paul


- Paul



Reply via email to