you are correct, the jde_meta.html that was being written contained 4 src= lines.  
Only the line pointing to the requested document was relative to an http link the rest 
work pointing to a non-existint doc directory under my jdk_home.

The fix I made was to invert lines 2 and 3 from this snippet:
Origional:
>           (if (string= (jde-help-docset-get-type temp) "JDK API")
>               (setq dir (jde-file-to-url (expand-file-name "docs/api" 
>(jde-get-jdk-dir))))
>             (setq dir (jde-file-to-url (jde-help-docset-get-dir temp))))

Changed:

>           (if (string= (jde-help-docset-get-type temp) "JDK API")
>               (setq dir (jde-file-to-url (jde-help-docset-get-dir temp)))
>             (setq dir (jde-file-to-url (expand-file-name "docs/api" 
>(jde-get-jdk-dir)))))

I tried your new function and it seems to be okay.  But in examing your if it seems 
it will return the local path if the document exists otherwise it will return the 
remote
path.  I may be reading it wrong though.  If I'm reading it correctlly I would argue 
that 
it is giving the wrong result,  if I've set my docset to use a remote set of documents 
then
I would expect them to come from there not from my local file system.

On Wed, Dec 12, 2001 at 12:25:17AM -0500, Paul Kinnucan wrote:
> Brad Giaccio writes:
>  > I noticed a bug when using jde-help-symbol with a docset that is not remote
>  > the problem is in jde-help-get-root-dir:
>  > 
> 
> I don't understand the bug. What are the symptoms? The function
> works for me. However, I did find a small bug. The function
> assumes that a JDK API docset is always in the current JDK
> directory. This may not be the case. Here is my updated version
> of the function. I have checked it into the CVS repository.
> 
> - Paul
> 
> (defun jde-help-get-root-dir (docfile)
>   "Returns the javadoc root directory of docfile"
>   (if jde-help-docsets
>       (let ((docsets jde-help-docsets)
>           dir)
>         (while docsets
>         (let ((docset (car docsets)))
>           (setq dir (jde-help-docset-get-dir docset))
>           (if (and
>                (or (not dir)
>                    (string= dir ""))
>                (string= (jde-help-docset-get-type docset) "JDK API"))
>               (setq dir (expand-file-name "docs/api" (jde-get-jdk-dir))))
>           (setq dir (jde-file-to-url (concat dir "/")))                    
>           (if (string-match dir docfile)
>               (setq docsets nil)
>             (setq docsets (cdr docsets)))))
>         dir)))
>  
> 
>  > (defun jde-help-get-root-dir (docfile)
>  >   "Returns the javadoc root directory of docfile"
>  >   (if jde-help-docsets
>  >       (let ((docsets jde-help-docsets)
>  >             temp dir)
>  >         (while docsets
>  >           (setq temp (car docsets))
>  >           (if (string= (jde-help-docset-get-type temp) "JDK API")
>  >               (setq dir (jde-file-to-url (expand-file-name "docs/api" 
>(jde-get-jdk-dir))))
>  >             (setq dir (jde-file-to-url (jde-help-docset-get-dir temp))))
>  >           (if (string-match dir docfile)
>  >               (setq docsets nil))
>  >           (setq docsets (cdr docsets)))
>  >         (setq dir (jde-file-to-url (concat dir "/")))
>  >         dir)))
>  > 
>  > The if and else for string= are backwards they should be:
>  > 
>  > (defun jde-help-get-root-dir (docfile)
>  >   "Returns the javadoc root directory of docfile"
>  >   (if jde-help-docsets
>  >       (let ((docsets jde-help-docsets)
>  >             temp dir)
>  >         (while docsets
>  >           (setq temp (car docsets))
>  >           (if (string= (jde-help-docset-get-type temp) "JDK API")
>  >             (setq dir (jde-file-to-url (jde-help-docset-get-dir temp)))
>  >               (setq dir (jde-file-to-url (expand-file-name "docs/api" 
>(jde-get-jdk-dir)))))
>  >           (if (string-match dir docfile)
>  >               (setq docsets nil))
>  >           (setq docsets (cdr docsets)))
>  >         (setq dir (jde-file-to-url (concat dir "/")))
>  >         dir)))
>  > 
>  > This is 2.2.7beta 7   revision 1.44 of jde-help.el
>  > 
>  > Brad
>  > -- 
>  > --- There are two kinds of knowledge, you either know the answer or
>  >                    you know where to find it
>  >                  -Kane, Johnson, and anonymous
>  > 

-- 
--- There are two kinds of knowledge, you either know the answer or
                        you know where to find it
                      -Kane, Johnson, and anonymous

Reply via email to