-;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-;; Free Software Foundation, Inc.
+;; Copyright (C) 2000-2011 Free Software Foundation, Inc.
;;
;; Authors: J.D. Smith <jdsmith@as.arizona.edu>
;; Carsten Dominik <dominik@science.uva.nl>
;; Maintainer: J.D. Smith <jdsmith@as.arizona.edu>
;;
;; Authors: J.D. Smith <jdsmith@as.arizona.edu>
;; Carsten Dominik <dominik@science.uva.nl>
;; Maintainer: J.D. Smith <jdsmith@as.arizona.edu>
(if idlwave-html-help-pre-v6 "#" "#wp"))
(defcustom idlwave-html-system-help-location "help/online_help/"
(if idlwave-html-help-pre-v6 "#" "#wp"))
(defcustom idlwave-html-system-help-location "help/online_help/"
HTML help files live, for IDL 6.2 and later. This location, if found,
HTML help files live, for IDL 6.2 and later. This location, if found,
Defaults to `browse-url-browser-function', which see."
:group 'idlwave-online-help
:type 'function)
(defcustom idlwave-help-browser-generic-program browse-url-generic-program
Defaults to `browse-url-browser-function', which see."
:group 'idlwave-online-help
:type 'function)
(defcustom idlwave-help-browser-generic-program browse-url-generic-program
(defcustom idlwave-help-browser-generic-args
(if (boundp 'browse-url-generic-args)
browse-url-generic-args "")
(defcustom idlwave-help-browser-generic-args
(if (boundp 'browse-url-generic-args)
browse-url-generic-args "")
(defcustom idlwave-help-use-dedicated-frame t
"*Non-nil means, use a separate frame for Online Help if possible."
(defcustom idlwave-help-use-dedicated-frame t
"*Non-nil means, use a separate frame for Online Help if possible."
(defvar idlwave-help-window-configuration nil)
(defvar idlwave-help-special-topic-words nil) ; defined by get_rinfo
(defvar idlwave-help-window-configuration nil)
(defvar idlwave-help-special-topic-words nil) ; defined by get_rinfo
;; Define the key bindings for the Help application
(defvar idlwave-help-mode-map (make-sparse-keymap)
;; Define the key bindings for the Help application
(defvar idlwave-help-mode-map (make-sparse-keymap)
(define-key idlwave-help-mode-map "q" 'idlwave-help-quit)
(define-key idlwave-help-mode-map "w" 'widen)
(define-key idlwave-help-mode-map "q" 'idlwave-help-quit)
(define-key idlwave-help-mode-map "w" 'widen)
(declare-function idlwave-what-module-find-class "idlwave")
(declare-function idlwave-where "idlwave")
(declare-function idlwave-what-module-find-class "idlwave")
(declare-function idlwave-where "idlwave")
"Major mode for displaying IDL Help.
This is a VIEW mode for the ASCII version of IDL Help files,
"Major mode for displaying IDL Help.
This is a VIEW mode for the ASCII version of IDL Help files,
Fontification: [F]ontify the buffer like source code
Jump: [h] to function doclib header
[H] to file doclib header
Fontification: [F]ontify the buffer like source code
Jump: [h] to function doclib header
[H] to file doclib header
(setq buffer-read-only t)
(set (make-local-variable 'idlwave-help-def-pos) nil)
(set (make-local-variable 'idlwave-help-args) nil)
(setq buffer-read-only t)
(set (make-local-variable 'idlwave-help-def-pos) nil)
(set (make-local-variable 'idlwave-help-args) nil)
(defun idlwave-html-help-location ()
"Return the help directory where HTML files are, or nil if that is unknown."
(defun idlwave-html-help-location ()
"Return the help directory where HTML files are, or nil if that is unknown."
(message "Cannot locate IDL Assistant, enabling default browser.")
(setq idlwave-help-use-assistant nil)
(unless idlwave-help-browse-url-available
(message "Cannot locate IDL Assistant, enabling default browser.")
(setq idlwave-help-use-assistant nil)
(unless idlwave-help-browse-url-available
(defvar idlwave-experimental)
(defvar idlwave-last-context-help-pos)
(defun idlwave-do-context-help (&optional arg)
(defvar idlwave-experimental)
(defvar idlwave-last-context-help-pos)
(defun idlwave-do-context-help (&optional arg)
It collects and prints the diagnostics messages."
(let ((marker (list (current-buffer) (point)))
(idlwave-help-diagnostics nil))
It collects and prints the diagnostics messages."
(let ((marker (list (current-buffer) (point)))
(idlwave-help-diagnostics nil))
;; XXX is this necessary, given all-method-classes?
(if (stringp class)
(setq class (idlwave-find-inherited-class
;; XXX is this necessary, given all-method-classes?
(if (stringp class)
(setq class (idlwave-find-inherited-class
;; XXX is this necessary, given all-method-keyword-classes?
(if (stringp class)
(setq class (idlwave-find-inherited-class
;; XXX is this necessary, given all-method-keyword-classes?
(if (stringp class)
(setq class (idlwave-find-inherited-class
"Display HTML or other special help on a certain topic.
Either loads an HTML link, if LINK is non-nil, or gets special-help on
the optional arguments, if any special help is defined. If LINK is
"Display HTML or other special help on a certain topic.
Either loads an HTML link, if LINK is non-nil, or gets special-help on
the optional arguments, if any special help is defined. If LINK is
(defun idlwave-help-get-special-help (name type class keyword)
"Call the function given by `idlwave-extra-help-function'."
(let* ((cw (selected-window))
(defun idlwave-help-get-special-help (name type class keyword)
"Call the function given by `idlwave-extra-help-function'."
(let* ((cw (selected-window))
(let ((buffer-read-only nil))
(funcall idlwave-extra-help-function
name type class keyword)))))
(let ((buffer-read-only nil))
(funcall idlwave-extra-help-function
name type class keyword)))))
(let ((browse-url-browser-function idlwave-help-browser-function)
(help-loc (idlwave-html-help-location))
(browse-url-generic-program idlwave-help-browser-generic-program)
(let ((browse-url-browser-function idlwave-help-browser-function)
(help-loc (idlwave-html-help-location))
(browse-url-generic-program idlwave-help-browser-generic-program)
;; Just a regular file name (+ anchor name)
(unless (and (stringp help-loc)
(file-directory-p help-loc))
;; Just a regular file name (+ anchor name)
(unless (and (stringp help-loc)
(file-directory-p help-loc))
(defvar idlwave-current-tags-buffer)
(defvar idlwave-current-tags-class)
(defun idlwave-help-with-source (name type class keyword)
(defvar idlwave-current-tags-buffer)
(defvar idlwave-current-tags-class)
(defun idlwave-help-with-source (name type class keyword)
- "Provide help for routines not documented in the IDL manuals. Works
-by loading the routine source file into the help buffer. Depending on
-the value of `idlwave-help-source-try-header', it attempts to show the
-routine definition or the header description. If
-`idlwave-help-do-class-struct-tag' is non-nil, keyword is a tag to
-show help on from the class definition structure. If
-`idlwave-help-do-struct-tag' is non-nil, show help from the matching
-structure tag definition.
+ "Provide help for routines not documented in the IDL manuals.
+Works by loading the routine source file into the help buffer.
+Depending on the value of `idlwave-help-source-try-header', it
+attempts to show the routine definition or the header description.
+If `idlwave-help-do-class-struct-tag' is non-nil, keyword is a tag
+to show help on from the class definition structure.
+If `idlwave-help-do-struct-tag' is non-nil, show help from the
+matching structure tag definition.
This function can be used as `idlwave-extra-help-function'."
(let* ((class-struct-tag idlwave-help-do-class-struct-tag)
This function can be used as `idlwave-extra-help-function'."
(let* ((class-struct-tag idlwave-help-do-class-struct-tag)
(defun idlwave-help-find-routine-definition (name type class keyword)
"Find the definition of routine CLASS::NAME in current buffer.
(defun idlwave-help-find-routine-definition (name type class keyword)
"Find the definition of routine CLASS::NAME in current buffer.
(unless (accept-process-output idlwave-help-assistant-process 15)
(error "Failed binding IDL_ASSISTANT socket"))
(if (not port)
(unless (accept-process-output idlwave-help-assistant-process 15)
(error "Failed binding IDL_ASSISTANT socket"))
(if (not port)
(set-process-filter idlwave-help-assistant-process nil)
(setq idlwave-help-assistant-socket
(open-network-stream "IDL_ASSISTANT_SOCK"
(set-process-filter idlwave-help-assistant-process nil)
(setq idlwave-help-assistant-socket
(open-network-stream "IDL_ASSISTANT_SOCK"
(if (string-match "\.html" link)
(setq topic (substring link 0 (match-beginning 0))
anchor (substring link (match-end 0)))
(if (string-match "\.html" link)
(setq topic (substring link 0 (match-beginning 0))
anchor (substring link (match-end 0)))