Skip to content

Commit

Permalink
Implement new "idl.htm#path/to/file" method of linking
Browse files Browse the repository at this point in the history
  • Loading branch information
jdtsmith committed Jan 27, 2014
1 parent 687c9f0 commit 7d07b19
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions idlw-help.el
Original file line number Diff line number Diff line change
Expand Up @@ -568,19 +568,23 @@ see if a link is set for it. Try extra help functions if necessary."

(defun idlwave-help-html-link (link)
"Get html help on a given LINK."
(let ((browse-url-browser-function idlwave-help-browser-function)
(browse-url-generic-program idlwave-help-browser-generic-program)
;(browse-url-generic-args idlwave-help-browser-generic-args)
(help-loc (idlwave-html-help-location))
full-link)
(let* ((browse-url-browser-function idlwave-help-browser-function)
(browse-url-generic-program idlwave-help-browser-generic-program)
(help-loc (idlwave-html-help-location))
(alternate (expand-file-name "idl.htm" (file-name-directory help-loc)))
full-link)

;; Just a regular file name (+ anchor name)
(unless (or idlwave-help-use-eclipse-help
(and (stringp help-loc)
(file-directory-p help-loc)))
(error "Invalid help request"))

(setq full-link (browse-url-file-url (expand-file-name link help-loc)))
;; If possible, subsume as anchor under idl.htm
(if (file-exists-p alternate)
(setq help-loc (concat alternate "#")))

(setq full-link (browse-url-file-url (concat help-loc link)))

;; Select the browser
(cond
Expand Down

0 comments on commit 7d07b19

Please sign in to comment.