;;; idlw-help.el --- HTML Help code for IDLWAVE
-;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; 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>
:type 'string)
(defface idlwave-help-link
- '((((class color)) (:foreground "Blue"))
- (t (:weight bold)))
+ '((t :inherit link))
"Face for highlighting links into IDLWAVE online help."
:group 'idlwave-online-help)
;; Define the key bindings for the Help application
-(defvar idlwave-help-mode-map (make-sparse-keymap)
+(defvar idlwave-help-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "q" 'idlwave-help-quit)
+ (define-key map "w" 'widen)
+ (define-key map "\C-m" (lambda (arg)
+ (interactive "p")
+ (scroll-up arg)))
+ (define-key map " " 'scroll-up-command)
+ (define-key map [delete] 'scroll-down-command)
+ (define-key map "h" 'idlwave-help-find-header)
+ (define-key map "H" 'idlwave-help-find-first-header)
+ (define-key map "." 'idlwave-help-toggle-header-match-and-def)
+ (define-key map "F" 'idlwave-help-fontify)
+ (define-key map "\M-?" 'idlwave-help-return-to-calling-frame)
+ (define-key map "x" 'idlwave-help-return-to-calling-frame)
+ map)
"The keymap used in `idlwave-help-mode'.")
-(define-key idlwave-help-mode-map "q" 'idlwave-help-quit)
-(define-key idlwave-help-mode-map "w" 'widen)
-(define-key idlwave-help-mode-map "\C-m" (lambda (arg)
- (interactive "p")
- (scroll-up arg)))
-(define-key idlwave-help-mode-map " " 'scroll-up)
-(define-key idlwave-help-mode-map [delete] 'scroll-down)
-(define-key idlwave-help-mode-map "h" 'idlwave-help-find-header)
-(define-key idlwave-help-mode-map "H" 'idlwave-help-find-first-header)
-(define-key idlwave-help-mode-map "." 'idlwave-help-toggle-header-match-and-def)
-(define-key idlwave-help-mode-map "F" 'idlwave-help-fontify)
-(define-key idlwave-help-mode-map "\M-?" 'idlwave-help-return-to-calling-frame)
-(define-key idlwave-help-mode-map "x" 'idlwave-help-return-to-calling-frame)
-
;; Define the menu for the Help application
(easy-menu-define
(declare-function idlwave-what-module-find-class "idlwave")
(declare-function idlwave-where "idlwave")
-(defun idlwave-help-mode ()
+(define-derived-mode idlwave-help-mode special-mode "IDLWAVE Help"
"Major mode for displaying IDL Help.
This is a VIEW mode for the ASCII version of IDL Help files,
Here are all keybindings.
\\{idlwave-help-mode-map}"
- (kill-all-local-variables)
(buffer-disable-undo)
- (setq major-mode 'idlwave-help-mode
- mode-name "IDLWAVE Help")
- (use-local-map idlwave-help-mode-map)
(easy-menu-add idlwave-help-menu idlwave-help-mode-map)
(setq truncate-lines t)
(setq case-fold-search t)
(setq buffer-read-only t)
(set (make-local-variable 'idlwave-help-def-pos) nil)
(set (make-local-variable 'idlwave-help-args) nil)
- (set (make-local-variable 'idlwave-help-in-header) nil)
- (run-hooks 'idlwave-help-mode-hook))
+ (set (make-local-variable 'idlwave-help-in-header) nil))
(defun idlwave-html-help-location ()
"Return the help directory where HTML files are, or nil if that is unknown."
(let* ((cw (selected-window))
(info idlwave-completion-help-info) ; global passed in
(what (nth 0 info))
- (name (nth 1 info))
+ (idlw-help-name (nth 1 info))
(type (nth 2 info))
(class (nth 3 info))
(need-class class)
- (kwd (nth 4 info))
+ (idlw-help-kwd (nth 4 info))
(sclasses (nth 5 info))
- word link)
+ word idlw-help-link)
(mouse-set-point ev)
(setq word (idlwave-this-word))
(if (string= word "")
(error "No help item selected"))
- (setq link (get-text-property 0 'link word))
+ (setq idlw-help-link (get-text-property 0 'link word))
(select-window cw)
(cond
;; Routine name
((memq what '(procedure function routine))
- (setq name word)
+ (setq idlw-help-name word)
(if (or (eq class t)
(and (stringp class) sclasses))
(let* ((classes (idlwave-all-method-classes
- (idlwave-sintern-method name)
+ (idlwave-sintern-method idlw-help-name)
type)))
- (setq link t) ; No specific link valid yet
+ (setq idlw-help-link t) ; No specific link valid yet
(if sclasses
(setq classes (idlwave-members-only
classes (cons class sclasses))))
;; XXX is this necessary, given all-method-classes?
(if (stringp class)
(setq class (idlwave-find-inherited-class
- (idlwave-sintern-routine-or-method name class)
+ (idlwave-sintern-routine-or-method idlw-help-name class)
type (idlwave-sintern-class class)))))
;; Keyword
((eq what 'keyword)
- (setq kwd word)
+ (setq idlw-help-kwd word)
(if (or (eq class t)
(and (stringp class) sclasses))
(let ((classes (idlwave-all-method-keyword-classes
- (idlwave-sintern-method name)
- (idlwave-sintern-keyword kwd)
+ (idlwave-sintern-method idlw-help-name)
+ (idlwave-sintern-keyword idlw-help-kwd)
type)))
- (setq link t) ; Link can't be correct yet
+ (setq idlw-help-link t) ; Link can't be correct yet
(if sclasses
(setq classes (idlwave-members-only
classes (cons class sclasses))))
;; XXX is this necessary, given all-method-keyword-classes?
(if (stringp class)
(setq class (idlwave-find-inherited-class
- (idlwave-sintern-routine-or-method name class)
+ (idlwave-sintern-routine-or-method
+ idlw-help-name class)
type (idlwave-sintern-class class)))))
- (if (string= (downcase name) "obj_new")
+ (if (string= (downcase idlw-help-name) "obj_new")
(setq class idlwave-current-obj_new-class
- name "Init"))))
+ idlw-help-name "Init"))))
;; Class name
((eq what 'class)
(funcall what 'set word))
(t (error "Cannot help with this item")))
- (if (and need-class (not class) (not (and link (not (eq link t)))))
+ (if (and need-class (not class)
+ (not (and idlw-help-link (not (eq idlw-help-link t)))))
(error "Cannot help with this item"))
- (idlwave-online-help link (or name word) type class kwd)))
+ (idlwave-online-help idlw-help-link (or idlw-help-name word)
+ type class idlw-help-kwd)))
(defvar idlwave-highlight-help-links-in-completion)
(defvar idlwave-completion-help-links)
;; we kill the help frame before the return-frame is selected.
;; To protect the workings, we wait for up to one second
;; and check if the return-frame *is* now selected.
- ;; This is marked "eperimental" since we are not sure when its OK.
+ ;; This is marked "experimental" since we are not sure when
+ ;; it's OK.
(let ((maxtime 1.0) (time 0.) (step 0.1))
(select-frame idlwave-help-return-frame)
(while (and (sit-for step)
((or idlwave-help-browser-is-local
(string-match "w3" (symbol-name idlwave-help-browser-function)))
- (idlwave-help-display-help-window '(lambda () (browse-url full-link))))
+ (idlwave-help-display-help-window (lambda () (browse-url full-link))))
(t (browse-url full-link)))))
be found. TYPE is ignored.
This function expects a more or less standard routine header. In
-particlar it looks for the `NAME:' tag, either with a colon, or alone
+particular it looks for the `NAME:' tag, either with a colon, or alone
on a line. Then `NAME:' must be followed by the routine name on the
same or the next line. When KEYWORD is non-nil, looks first for a
-`KEYWORDS' section. It is amazing how inconsisten this is through
+`KEYWORDS' section. It is amazing how inconsistent this is through
some IDL libraries I have seen. We settle for a line containing an
-upper case \"KEYWORD\" string. If this line is not fould we search
+upper case \"KEYWORD\" string. If this line is not found we search
for the keyword anyway to increase the hit-rate
When one of these sections exists we check for a line starting with any of
(provide 'idlw-help)
(provide 'idlwave-help)
-;; arch-tag: d27b5505-59de-497f-ba3f-f199fd4fb911
;;; idlw-help.el ends here