annotate lisp/progmodes/idlw-help.el @ 65055:0b9598224a95

(compilation-disable-input): Default to nil.
author Richard M. Stallman <rms@gnu.org>
date Sat, 20 Aug 2005 21:47:06 +0000
parents fb2cad4cfb30
children 115e36d1b11e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1 ;;; idlw-help.el --- HTML Help code for IDLWAVE
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
2 ;; Copyright (c) 2000 Carsten Dominik
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
3 ;; Copyright (c) 2001, 2002 J.D. Smith
64699
629afbe74e61 Update copyright for release of 22.1 for progmodes directory.
Nick Roberts <nickrob@snap.net.nz>
parents: 64085
diff changeset
4 ;; Copyright (c) 2003, 2004, 2005, Free Software Foundation
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
5 ;;
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
6 ;; Authors: J.D. Smith <jdsmith@as.arizona.edu>
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
7 ;; Carsten Dominik <dominik@science.uva.nl>
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
8 ;; Maintainer: J.D. Smith <jdsmith@as.arizona.edu>
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
9 ;; Version: 5.7_22
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
10
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
11 ;; This file is part of GNU Emacs.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
12
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
13 ;; This file is free software; you can redistribute it and/or modify
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
14 ;; it under the terms of the GNU General Public License as published by
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
15 ;; the Free Software Foundation; either version 2, or (at your option)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
16 ;; any later version.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
17
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
18 ;; This file is distributed in the hope that it will be useful,
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
21 ;; GNU General Public License for more details.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
22
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
23 ;; You should have received a copy of the GNU General Public License
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
24 ;; along with GNU Emacs; see the file COPYING. If not, write to the
64085
18a818a2ee7c Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 64001
diff changeset
25 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18a818a2ee7c Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 64001
diff changeset
26 ;; Boston, MA 02110-1301, USA.
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
27
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
28 ;;; Commentary:
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
29
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
30 ;; The help link information for IDLWAVE's online help feature for
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
31 ;; system routines is extracted automatically from the IDL
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
32 ;; documentation, and is available, along with general routine
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
33 ;; information, in the file idlw-rinfo.el. The HTML help file
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
34 ;; themselves are not distributable with Emacs, but are available,
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
35 ;; along with new versions of IDLWAVE, documentation, and more
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
36 ;; information, at:
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
37 ;;
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
38 ;; http://idlwave.org
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
39 ;;
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
40 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
41
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
42
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
43 ;;; Code:
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
44 (defvar idlwave-help-browse-url-available nil
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
45 "Whether browse-url is available")
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
46
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
47 (setq idlwave-help-browse-url-available
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
48 (condition-case nil
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
49 (require 'browse-url)
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
50 (error nil)))
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
51
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
52 (defgroup idlwave-online-help nil
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
53 "Online Help options for IDLWAVE mode."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
54 :group 'idlwave)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
55
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
56 (defcustom idlwave-html-help-pre-v6 nil
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
57 "Whether pre or post-v6.0 IDL help documents are being used."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
58 :group 'idlwave-online-help
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
59 :type 'boolean)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
60
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
61 (defvar idlwave-html-link-sep
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
62 (if idlwave-html-help-pre-v6 "#" "#wp"))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
63
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
64 (defcustom idlwave-html-help-location
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
65 (if (memq system-type '(ms-dos windows-nt))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
66 nil
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
67 "/usr/local/etc/")
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
68 "The directory where the idl_html_help/ dir or idl.chm help file
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
69 (Windows only) lives."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
70 :group 'idlwave-online-help
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
71 :type 'directory)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
72
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
73 (defcustom idlwave-help-use-hh nil
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
74 "Whether to use the HTMLHelp viewer with idl.chm (Windows only)."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
75 :group 'idlwave-online-help
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
76 :type '(choice :tag "use help viewer"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
77 (const :tag "<none>" nil)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
78 (const :tag "hh" 'hh)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
79 (const :tag "keyhh" 'keyhh)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
80
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
81 (defcustom idlwave-help-browser-function browse-url-browser-function
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
82 "Function to use to display html help.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
83 Defaults to `browse-url-browser-function', which see."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
84 :group 'idlwave-online-help
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
85 :type 'function)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
86
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
87 (defcustom idlwave-help-browser-generic-program browse-url-generic-program
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
88 "Program to run if using browse-url-generic-program."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
89 :group 'idlwave-online-help
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
90 :type 'string)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
91
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
92 (defcustom idlwave-help-browser-generic-args
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
93 (if (boundp 'browse-url-generic-args)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
94 browse-url-generic-args "")
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
95 "Program args to use if using browse-url-generic-program."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
96 :group 'idlwave-online-help
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
97 :type 'string)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
98
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
99 (defcustom idlwave-help-browser-is-local nil
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
100 "Whether the browser will display locally in an Emacs window.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
101 Several browsers run and/or display inside Emacs windows, but most are
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
102 external programs. If the browser name contains \"-w3\", it is
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
103 assumed to be local to Emacs. For other local browsers, this variable
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
104 must be explicitly set non-nil in order for the variable
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
105 `idlwave-help-use-dedicated-frame' to function."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
106 :group 'idlwave-online-help
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
107 :type 'boolean)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
108
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
109 (defvar idlwave-help-directory ""
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
110 "Obsolete variable. See idlwave-html-help-location.")
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
111
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
112 (defcustom idlwave-help-use-dedicated-frame t
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
113 "*Non-nil means, use a separate frame for Online Help if possible."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
114 :group 'idlwave-online-help
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
115 :type 'boolean)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
116
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
117 (defcustom idlwave-help-frame-parameters
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
118 '((height . 32) (unsplittable . t))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
119 "The frame parameters for the special Online Help frame.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
120 See also `idlwave-help-use-dedicated-frame'.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
121 If you do not set the frame width here, the value specified in
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
122 `idlw-help.el' will be used."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
123 :group 'idlwave-online-help
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
124 :type '(repeat
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
125 (cons symbol sexp)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
126
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
127 (defcustom idlwave-max-popup-menu-items 20
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
128 "Maximum number of items per pane in popup menus.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
129 Currently only used for class selection during completion help."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
130 :group 'idlwave-online-help
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
131 :type 'integer)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
132
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
133 (defcustom idlwave-extra-help-function 'idlwave-help-with-source
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
134 "The function to call for online help if the normal help fails.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
135 Online help works only for system routines which are described in the
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
136 IDL manuals. A function may be specified to access help from other sources.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
137
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
138 The function must accept four arguments: NAME, TYPE, CLASS, KEYWORD.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
139 The Help buffer is current when this function is called, and the help
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
140 text should be loaded into this buffer. If help is found, the
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
141 function should return the buffer position which should be used as
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
142 `window-start' in the help window. Also, the variable
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
143 `idlwave-help-mode-line-indicator' should be set to a useful string,
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
144 which will be displayed in the mode line of the help window. If
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
145 should also set the variable `idlwave-help-min-frame-width' to a
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
146 positive integer. IDLWAVE will ensure that the help frame is at least
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
147 that many columns wide. Failure to find help should be indicated by
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
148 throwing an error.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
149
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
150 When this variable is non-nil, IDLWAVE will allow the mouse-3 help click
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
151 for every routine and keyword, even though the item may not be highlighted
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
152 in blue (indicating the availability of system documentation).
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
153
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
154 The default value for this function is `idlwave-help-with-source' which
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
155 loads the routine source file into the help buffer. If you try to write
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
156 a different function which accesses a special help file or so, it is
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
157 probably a good idea to still call this function as a fallback."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
158 :group 'idlwave-online-help
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
159 :type 'symbol)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
160
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
161 (defcustom idlwave-help-fontify-source-code nil
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
162 "*Non-nil means, fontify source code displayed as help like normal code."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
163 :group 'idlwave-online-help
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
164 :type 'boolean)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
165
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
166 (defcustom idlwave-help-source-try-header t
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
167 "*Non-nil means, try to find help in routine header when displaying source.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
168 Routines which are not documented in the system manual use their source as
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
169 help text. When this variable is non-nil, we try to find a description of
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
170 the help item in the first routine doclib header above the routine definition.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
171 If the variable is nil, or if we cannot find/parse the header, the routine
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
172 definition is displayed instead."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
173 :group 'idlwave-online-help
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
174 :type 'boolean)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
175
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
176
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
177 (defcustom idlwave-help-doclib-name "name"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
178 "*A regexp for the heading word to search for in doclib headers
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
179 which specifies the `name' section. Can be used for localization
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
180 support."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
181 :group 'idlwave-online-help
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
182 :type 'string)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
183
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
184 (defcustom idlwave-help-doclib-keyword "KEYWORD"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
185 "*A regexp for the heading word to search for in doclib headers
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
186 which specifies the `keywords' section. Can be used for localization
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
187 support."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
188 :group 'idlwave-online-help
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
189 :type 'string)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
190
63450
87216f91a211 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-413
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
191 (defface idlwave-help-link
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
192 '((((class color)) (:foreground "Blue"))
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
193 (t (:weight bold)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
194 "Face for highlighting links into IDLWAVE online help."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
195 :group 'idlwave-online-help)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
196
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
197 (defvar idlwave-help-activate-links-aggressively nil
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
198 "Obsolete variable.")
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
199
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
200 (defvar idlwave-completion-help-info)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
201
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
202 (defvar idlwave-help-frame nil
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
203 "The frame for display of IDL online help.")
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
204 (defvar idlwave-help-frame-width 102
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
205 "The default width of the help frame.")
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
206
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
207 (defvar idlwave-html-help-is-available nil
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
208 "Is the system online help text avaiable?")
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
209
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
210 (defvar idlwave-help-mode-line-indicator ""
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
211 "Used for the special mode line in the idlwave-help-mode.")
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
212
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
213 (defvar idlwave-help-window-configuration nil)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
214 (defvar idlwave-help-special-topic-words nil) ; defined by get_rinfo
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
215
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
216 ;; Define the key bindings for the Help application
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
217
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
218 (defvar idlwave-help-mode-map (make-sparse-keymap)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
219 "The keymap used in idlwave-help-mode.")
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
220
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
221 (define-key idlwave-help-mode-map "q" 'idlwave-help-quit)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
222 (define-key idlwave-help-mode-map "w" 'widen)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
223 (define-key idlwave-help-mode-map "\C-m" (lambda (arg)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
224 (interactive "p")
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
225 (scroll-up arg)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
226 (define-key idlwave-help-mode-map " " 'scroll-up)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
227 (define-key idlwave-help-mode-map [delete] 'scroll-down)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
228 (define-key idlwave-help-mode-map "h" 'idlwave-help-find-header)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
229 (define-key idlwave-help-mode-map "H" 'idlwave-help-find-first-header)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
230 (define-key idlwave-help-mode-map "." 'idlwave-help-toggle-header-match-and-def)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
231 (define-key idlwave-help-mode-map "F" 'idlwave-help-fontify)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
232 (define-key idlwave-help-mode-map "\M-?" 'idlwave-help-return-to-calling-frame)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
233 (define-key idlwave-help-mode-map "x" 'idlwave-help-return-to-calling-frame)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
234
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
235 ;; Define the menu for the Help application
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
236
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
237 (easy-menu-define
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
238 idlwave-help-menu idlwave-help-mode-map
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
239 "Menu for Help IDLWAVE system"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
240 '("IDLHelp"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
241 ["Definition <-> Help Text" idlwave-help-toggle-header-match-and-def t]
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
242 ["Find DocLib Header" idlwave-help-find-header t]
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
243 ["Find First DocLib Header" idlwave-help-find-first-header t]
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
244 ["Fontify help buffer" idlwave-help-fontify t]
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
245 "--"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
246 ["Quit" idlwave-help-quit t]))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
247
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
248 (defvar idlwave-help-def-pos)
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
249 (defvar idlwave-help-args)
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
250 (defvar idlwave-help-in-header)
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
251
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
252 (defun idlwave-help-mode ()
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
253 "Major mode for displaying IDL Help.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
254
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
255 This is a VIEW mode for the ASCII version of IDL Help files,
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
256 with some extras. Its main purpose is speed - so don't
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
257 expect a fully hyper-linked help.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
258
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
259 Scrolling: SPC DEL RET
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
260 Text Searches: Inside Topic: Use Emacs search functions
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
261 Exit: [q]uit or mouse button 3 will kill the frame
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
262
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
263 When the hep text is a source file, the following commands are available
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
264
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
265 Fontification: [F]ontify the buffer like source code
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
266 Jump: [h] to function doclib header
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
267 [H] to file doclib header
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
268 [.] back and forward between header and definition
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
269
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
270 Here are all keybindings.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
271 \\{idlwave-help-mode-map}"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
272 (kill-all-local-variables)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
273 (buffer-disable-undo)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
274 (setq major-mode 'idlwave-help-mode
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
275 mode-name "IDLWAVE Help")
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
276 (use-local-map idlwave-help-mode-map)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
277 (easy-menu-add idlwave-help-menu idlwave-help-mode-map)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
278 (setq truncate-lines t)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
279 (setq case-fold-search t)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
280 (setq mode-line-format
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
281 (list ""
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
282 'mode-line-modified
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
283 'mode-line-buffer-identification
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
284 ": " 'idlwave-help-mode-line-indicator
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
285 " -%-"))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
286 (setq buffer-read-only t)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
287 (set (make-local-variable 'idlwave-help-def-pos) nil)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
288 (set (make-local-variable 'idlwave-help-args) nil)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
289 (set (make-local-variable 'idlwave-help-in-header) nil)
62772
f2892faa87d4 * progmodes/ada-mode.el (ada-mode):
Lute Kamstra <lute@gnu.org>
parents: 62121
diff changeset
290 (run-mode-hooks 'idlwave-help-mode-hook))
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
291
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
292 (defvar idlwave-system-directory)
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
293 (defun idlwave-html-help-location ()
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
294 "Return the help directory where HTML files are, or nil if that is unknown."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
295 (or (and (stringp idlwave-html-help-location)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
296 (> (length idlwave-html-help-location) 0)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
297 (file-directory-p idlwave-html-help-location)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
298 idlwave-html-help-location)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
299 (getenv "IDLWAVE_HELP_LOCATION")
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
300 (and (memq system-type '(ms-dos windows-nt)) ; Base it on sysdir
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
301 idlwave-help-use-hh
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
302 (stringp idlwave-system-directory)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
303 (> (length idlwave-system-directory) 0)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
304 (file-directory-p idlwave-system-directory)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
305 (expand-file-name "HELP" idlwave-system-directory))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
306
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
307 (defvar idlwave-current-obj_new-class)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
308 (defvar idlwave-help-diagnostics)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
309 (defvar idlwave-experimental)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
310 (defvar idlwave-last-context-help-pos)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
311 (defun idlwave-do-context-help (&optional arg)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
312 "Wrapper around the call to idlwave-context-help1.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
313 It collects and prints the diagnostics messages."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
314 (let ((marker (list (current-buffer) (point)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
315 (idlwave-help-diagnostics nil))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
316 ;; Check for frame switching. When the command is invoked twice
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
317 ;; at the same position, we try to switch to the help frame
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
318 ;; FIXME: Frame switching works only on XEmacs
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
319 (if (and idlwave-experimental
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
320 (equal last-command this-command)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
321 (equal idlwave-last-context-help-pos marker))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
322 (idlwave-help-select-help-frame)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
323 ;; Do the real thing.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
324 (setq idlwave-last-context-help-pos marker)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
325 (idlwave-do-context-help1 arg)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
326 (if idlwave-help-diagnostics
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
327 (message "%s" (mapconcat 'identity
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
328 (nreverse idlwave-help-diagnostics)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
329 "; "))))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
330
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
331 (defvar idlwave-help-do-class-struct-tag nil)
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
332 (defvar idlwave-structtag-struct-location)
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
333 (defvar idlwave-help-do-struct-tag nil)
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
334 (defvar idlwave-system-variables-alist)
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
335 (defvar idlwave-executive-commands-alist)
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
336 (defvar idlwave-system-class-info)
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
337 (defun idlwave-do-context-help1 (&optional arg)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
338 "The work-horse version of `idlwave-context-help', which see."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
339 (save-excursion
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
340 (if (equal (char-after) ?/)
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
341 (forward-char 1)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
342 (if (equal (char-before) ?=)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
343 (backward-char 1)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
344 (let* ((idlwave-query-class nil)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
345 (idlwave-force-class-query (equal arg '(4)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
346 (chars "a-zA-Z0-9_$.!")
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
347 (beg (save-excursion (skip-chars-backward chars) (point)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
348 (end (save-excursion (skip-chars-forward chars) (point)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
349 (this-word (buffer-substring-no-properties beg end))
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
350 (st-ass (assoc (downcase this-word)
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
351 idlwave-help-special-topic-words))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
352 (classtag (and (string-match "self\\." this-word)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
353 (< beg (- end 4))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
354 (structtag (and (fboundp 'idlwave-complete-structure-tag)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
355 (string-match "\\`\\([^.]+\\)\\." this-word)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
356 (< beg (- end 4))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
357 module keyword cw mod1 mod2 mod3)
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
358 (if (or arg
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
359 (and (not st-ass)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
360 (not classtag)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
361 (not structtag)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
362 (not (member (string-to-char this-word) '(?! ?.)))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
363 ;; Need the module information
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
364 (progn
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
365 ;; MODULE is (name type class), for this or any inheriting class
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
366 (setq module (idlwave-what-module-find-class)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
367 cw (nth 2 (idlwave-where))) ;what would we complete here?
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
368 ;; Correct for OBJ_NEW, we may need an INIT method instead.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
369 (if (equal (idlwave-downcase-safe (car module)) "obj_new")
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
370 (let* ((bos (save-excursion (idlwave-beginning-of-statement)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
371 (point)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
372 (str (buffer-substring bos (point))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
373 (if (string-match "OBJ_NEW([ \t]*['\"]\\([a-zA-Z][a-zA-Z0-9$_]+\\)['\"]" str)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
374 (setq module (list "init" 'fun (match-string 1 str))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
375 idlwave-current-obj_new-class (match-string 1 str))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
376 )))))
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
377 (cond
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
378 (arg (setq mod1 module))
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
379
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
380 ;; A special topic -- only system help
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
381 (st-ass (setq mod1 (list (cdr st-ass))))
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
382
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
383 ;; A system variable -- only system help
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
384 ((string-match
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
385 "\\`!\\([a-zA-Z0-9_]+\\)\\(\.\\([A-Za-z0-9_]+\\)\\)?"
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
386 this-word)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
387 (let* ((word (match-string-no-properties 1 this-word))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
388 (entry (assq (idlwave-sintern-sysvar word)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
389 idlwave-system-variables-alist))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
390 (tag (match-string-no-properties 3 this-word))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
391 (tag-target (if tag
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
392 (cdr
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
393 (assq (idlwave-sintern-sysvartag tag)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
394 (cdr (assq 'tags entry))))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
395 (link (nth 1 (assq 'link entry))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
396 (if tag-target
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
397 (setq link (idlwave-substitute-link-target link
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
398 tag-target)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
399 (setq mod1 (list link))))
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
400
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
401 ;; An executive command -- only system help
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
402 ((string-match "^\\.\\([A-Z_]+\\)" this-word)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
403 (let* ((word (match-string 1 this-word))
62121
9d18baf82550 (idlwave-do-context-help1, idlwave-highlight-linked-completions): Replace
Juanma Barranquero <lekktu@gmail.com>
parents: 61394
diff changeset
404 (link (cdr (assoc-string
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
405 word
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
406 idlwave-executive-commands-alist t))))
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
407 (setq mod1 (list link))))
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
408
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
409 ;; A class -- system OR in-text help (via class__define).
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
410 ((and (eq cw 'class)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
411 (or (idlwave-in-quote) ; e.g. obj_new
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
412 (re-search-backward "\\<inherits[ \t]+[A-Za-z0-9_]*\\="
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
413 (max (point-min) (- (point) 40)) t)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
414 ;; Class completion inside string delimiters must be
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
415 ;; the class inside OBJ_NEW.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
416 (let* ((entry (assq
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
417 (idlwave-sintern-class this-word)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
418 idlwave-system-class-info))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
419 (name (concat (downcase this-word) "__define"))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
420 (link (nth 1 (assq 'link entry))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
421 (setq mod1 (list link name 'pro))))
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
422
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
423 ;; A class structure tag (self.BLAH) -- only in-text help available
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
424 (classtag
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
425 (let ((tag (substring this-word (match-end 0)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
426 class-with found-in)
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
427 (when (setq class-with
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
428 (idlwave-class-or-superclass-with-tag
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
429 (nth 2 (idlwave-current-routine))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
430 tag))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
431 (setq found-in (idlwave-class-found-in class-with))
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
432 (if (assq (idlwave-sintern-class class-with)
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
433 idlwave-system-class-info)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
434 (error "No help available for system class tags"))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
435 (setq idlwave-help-do-class-struct-tag t)
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
436 (setq mod1 (list nil
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
437 (if found-in
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
438 (cons (concat found-in "__define") class-with)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
439 (concat class-with "__define"))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
440 'pro
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
441 nil ; no class.... it's a procedure!
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
442 tag)))))
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
443
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
444 ;; A regular structure tag -- only in text, and if
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
445 ;; optional `complete-structtag' loaded.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
446 (structtag
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
447 (let ((var (match-string 1 this-word))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
448 (tag (substring this-word (match-end 0))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
449 ;; Check if we need to update the "current" structure
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
450 (idlwave-prepare-structure-tag-completion var)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
451 (setq idlwave-help-do-struct-tag
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
452 idlwave-structtag-struct-location
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
453 mod1 (list nil nil nil nil tag))))
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
454
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
455 ;; A routine keyword -- in text or system help
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
456 ((and (memq cw '(function-keyword procedure-keyword))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
457 (stringp this-word)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
458 (string-match "\\S-" this-word)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
459 (not (string-match "!" this-word)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
460 (cond ((or (= (char-before beg) ?/)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
461 (save-excursion (goto-char end)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
462 (looking-at "[ \t]*=")))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
463 ;; Certainly a keyword. Check for abbreviation etc.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
464 (setq keyword (idlwave-expand-keyword this-word module))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
465 (cond
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
466 ((null keyword)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
467 (idlwave-help-diagnostics
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
468 (format "%s does not accept `%s' kwd"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
469 (idlwave-make-full-name (nth 2 module)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
470 (car module))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
471 (upcase this-word))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
472 'ding))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
473 ((consp keyword)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
474 (idlwave-help-diagnostics
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
475 (format "%d matches for kwd abbrev `%s'"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
476 (length keyword) this-word)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
477 'ding)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
478 ;; We continue anyway with the first match...
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
479 (setq keyword (car keyword))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
480 ;; Keyword, or just module
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
481 (setq mod1 (append (list t) module (list keyword)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
482 (setq mod2 (append (list t) module)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
483 ((equal (char-after end) ?\()
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
484 ;; A function - what-module will have caught this
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
485 (setq mod1 (append (list t) module)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
486 (t
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
487 ;; undecided - try function, keyword, then enclosing mod.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
488 ;; Check for keyword abbreviations, but do not report
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
489 ;; errors, because it might be something else.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
490 ;; FIXME: is this a good way to handle this?
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
491 (setq keyword (idlwave-expand-keyword this-word module))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
492 (if (consp keyword) (setq keyword (car keyword)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
493 (setq mod1 (append (list t) module (list keyword))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
494 mod2 (list t this-word 'fun nil)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
495 mod3 (append (list t) module)))))
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
496
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
497 ;; Everything else
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
498 (t
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
499 (setq mod1 (append (list t) module))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
500 (if mod3
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
501 (condition-case nil
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
502 (apply 'idlwave-online-help mod1)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
503 (error (condition-case nil
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
504 (apply 'idlwave-online-help mod2)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
505 (error (apply 'idlwave-online-help mod3)))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
506 (if mod2
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
507 (condition-case nil
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
508 (apply 'idlwave-online-help mod1)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
509 (error (apply 'idlwave-online-help mod2)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
510 (if mod1
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
511 (apply 'idlwave-online-help mod1)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
512 (error "Don't know which item to show help for")))))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
513
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
514 (defun idlwave-do-mouse-completion-help (ev)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
515 "Display online help on an item in the *Completions* buffer.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
516 Needs additional info stored in global `idlwave-completion-help-info'."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
517 (let* ((cw (selected-window))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
518 (info idlwave-completion-help-info) ; global passed in
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
519 (what (nth 0 info))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
520 (name (nth 1 info))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
521 (type (nth 2 info))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
522 (class (nth 3 info))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
523 (need-class class)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
524 (kwd (nth 4 info))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
525 (sclasses (nth 5 info))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
526 word link)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
527 (mouse-set-point ev)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
528
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
529
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
530 ;; See if we can also find help somewhere, e.g. for multiple classes
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
531 (setq word (idlwave-this-word))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
532 (if (string= word "")
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
533 (error "No help item selected"))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
534 (setq link (get-text-property 0 'link word))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
535 (select-window cw)
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
536 (cond
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
537 ;; Routine name
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
538 ((memq what '(procedure function routine))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
539 (setq name word)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
540 (if (or (eq class t)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
541 (and (stringp class) sclasses))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
542 (let* ((classes (idlwave-all-method-classes
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
543 (idlwave-sintern-method name)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
544 type)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
545 (setq link t) ; No specific link valid yet
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
546 (if sclasses
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
547 (setq classes (idlwave-members-only
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
548 classes (cons class sclasses))))
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
549 (setq class (idlwave-popup-select ev classes
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
550 "Select Class" 'sort))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
551
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
552 ;; XXX is this necessary, given all-method-classes?
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
553 (if (stringp class)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
554 (setq class (idlwave-find-inherited-class
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
555 (idlwave-sintern-routine-or-method name class)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
556 type (idlwave-sintern-class class)))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
557
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
558 ;; Keyword
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
559 ((eq what 'keyword)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
560 (setq kwd word)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
561 (if (or (eq class t)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
562 (and (stringp class) sclasses))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
563 (let ((classes (idlwave-all-method-keyword-classes
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
564 (idlwave-sintern-method name)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
565 (idlwave-sintern-keyword kwd)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
566 type)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
567 (setq link t) ; Link can't be correct yet
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
568 (if sclasses
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
569 (setq classes (idlwave-members-only
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
570 classes (cons class sclasses))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
571 (setq class (idlwave-popup-select ev classes
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
572 "Select Class" 'sort))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
573 ;; XXX is this necessary, given all-method-keyword-classes?
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
574 (if (stringp class)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
575 (setq class (idlwave-find-inherited-class
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
576 (idlwave-sintern-routine-or-method name class)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
577 type (idlwave-sintern-class class)))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
578 (if (string= (downcase name) "obj_new")
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
579 (setq class idlwave-current-obj_new-class
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
580 name "Init"))))
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
581
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
582 ;; Class name
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
583 ((eq what 'class)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
584 (setq class word
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
585 word nil))
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
586
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
587 ;; A special named function to call which sets some of our variables
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
588 ((and (symbolp what)
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
589 (fboundp what))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
590 (funcall what 'set word))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
591
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
592 (t (error "Cannot help with this item")))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
593 (if (and need-class (not class) (not (and link (not (eq link t)))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
594 (error "Cannot help with this item"))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
595 (idlwave-online-help link (or name word) type class kwd)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
596
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
597 (defvar idlwave-highlight-help-links-in-completion)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
598 (defvar idlwave-completion-help-links)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
599 (defun idlwave-highlight-linked-completions ()
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
600 "Highlight all completions for which help is available and attach link.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
601 Those words in `idlwave-completion-help-links' have links. The
63450
87216f91a211 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-413
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
602 `idlwave-help-link' face is used for this."
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
603 (if idlwave-highlight-help-links-in-completion
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
604 (with-current-buffer (get-buffer "*Completions*")
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
605 (save-excursion
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
606 (let* ((case-fold-search t)
63450
87216f91a211 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-413
Miles Bader <miles@gnu.org>
parents: 62772
diff changeset
607 (props (list 'face 'idlwave-help-link))
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
608 (info idlwave-completion-help-info) ; global passed in
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
609 (what (nth 0 info)) ; what was completed, or a func
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
610 (class (nth 3 info)) ; any class
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
611 word beg end doit)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
612 (goto-char (point-min))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
613 (re-search-forward "possible completions are:" nil t)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
614 (while (re-search-forward "\\s-\\([A-Za-z0-9_.]+\\)\\(\\s-\\|\\'\\)"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
615 nil t)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
616 (setq beg (match-beginning 1) end (match-end 1)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
617 word (match-string 1) doit nil)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
618 ;; Call special completion function test
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
619 (if (and (symbolp what)
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
620 (fboundp what))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
621 (setq doit (funcall what 'test word))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
622 ;; Look for special link property passed in help-links
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
623 (if idlwave-completion-help-links
62121
9d18baf82550 (idlwave-do-context-help1, idlwave-highlight-linked-completions): Replace
Juanma Barranquero <lekktu@gmail.com>
parents: 61394
diff changeset
624 (setq doit (assoc-string
9d18baf82550 (idlwave-do-context-help1, idlwave-highlight-linked-completions): Replace
Juanma Barranquero <lekktu@gmail.com>
parents: 61394
diff changeset
625 word idlwave-completion-help-links t))))
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
626 (when doit
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
627 (if (consp doit)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
628 (setq props (append props `(link ,(cdr doit)))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
629 (let ((buffer-read-only nil))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
630 (add-text-properties beg end props)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
631 (goto-char end)))))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
632
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
633 ;; Arrange for this function to be called after completion
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
634 (add-hook 'idlwave-completion-setup-hook
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
635 'idlwave-highlight-linked-completions)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
636
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
637 (defvar idlwave-help-return-frame nil
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
638 "The frame to return to from the help frame.")
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
639
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
640 (defun idlwave-help-quit ()
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
641 "Exit IDLWAVE Help buffer. Kill the dedicated frame if any."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
642 (interactive)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
643 (cond ((and idlwave-help-use-dedicated-frame
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
644 (eq (selected-frame) idlwave-help-frame))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
645 (if (and idlwave-experimental
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
646 (frame-live-p idlwave-help-return-frame))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
647 ;; Try to select the return frame.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
648 ;; This can crash on slow network connections, obviously when
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
649 ;; we kill the help frame before the return-frame is selected.
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
650 ;; To protect the workings, we wait for up to one second
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
651 ;; and check if the return-frame *is* now selected.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
652 ;; This is marked "eperimental" since we are not sure when its OK.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
653 (let ((maxtime 1.0) (time 0.) (step 0.1))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
654 (select-frame idlwave-help-return-frame)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
655 (while (and (sit-for step)
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
656 (not (eq (selected-frame)
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
657 idlwave-help-return-frame))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
658 (< (setq time (+ time step)) maxtime)))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
659 (delete-frame idlwave-help-frame))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
660 ((window-configuration-p idlwave-help-window-configuration)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
661 (set-window-configuration idlwave-help-window-configuration)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
662 (select-window (previous-window)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
663 (t (kill-buffer (idlwave-help-get-help-buffer)))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
664
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
665
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
666 (defvar default-toolbar-visible-p)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
667
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
668 (defun idlwave-help-display-help-window (&optional pos-or-func)
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
669 "Display the help window.
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
670 Move window start to POS-OR-FUNC, if passed as a position, or call it
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
671 if passed as a function. See `idlwave-help-use-dedicated-frame'."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
672 (let ((cw (selected-window))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
673 (buf (idlwave-help-get-help-buffer)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
674 (if (and window-system idlwave-help-use-dedicated-frame)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
675 (progn
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
676 (idlwave-help-show-help-frame)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
677 (switch-to-buffer buf))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
678 ;; Do it in this frame and save the window configuration
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
679 (if (not (get-buffer-window buf nil))
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
680 (setq idlwave-help-window-configuration
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
681 (current-window-configuration)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
682 (display-buffer buf nil (selected-frame))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
683 (select-window (get-buffer-window buf)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
684 (raise-frame)
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
685 (if pos-or-func
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
686 (if (functionp pos-or-func)
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
687 (funcall pos-or-func)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
688 (goto-char pos-or-func)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
689 (recenter 0)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
690 (select-window cw)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
691
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
692 (defun idlwave-help-select-help-frame ()
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
693 "Select the help frame."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
694 (if (and (frame-live-p idlwave-help-frame)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
695 (not (eq (selected-frame) idlwave-help-frame)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
696 (progn
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
697 (setq idlwave-help-return-frame (selected-frame))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
698 (select-frame idlwave-help-frame))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
699
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
700 (defun idlwave-help-return-to-calling-frame ()
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
701 "Select the frame from which the help frame was selected."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
702 (interactive)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
703 (if (and (frame-live-p idlwave-help-return-frame)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
704 (not (eq (selected-frame) idlwave-help-return-frame)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
705 (select-frame idlwave-help-return-frame)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
706
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
707 (defun idlwave-online-help (link &optional name type class keyword)
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
708 "Display HTML or other special help on a certain topic.
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
709 Either loads an HTML link, if LINK is non-nil, or gets special-help on
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
710 the optional arguments, if any special help is defined. If LINK is
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
711 `t', first look up the optional arguments in the routine info list to
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
712 see if a link is set for it. Try extra help functions if necessary."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
713 ;; Lookup link
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
714 (if (eq link t)
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
715 (let ((entry (idlwave-best-rinfo-assoc name type class
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
716 (idlwave-routines) nil t)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
717 (cond
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
718 ;; Try keyword link
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
719 ((and keyword
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
720 (setq link (cdr (idlwave-entry-find-keyword entry keyword)))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
721 ;; Default, regular entry link
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
722 (t (setq link (idlwave-entry-has-help entry))))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
723
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
724 (cond
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
725 ;; An explicit link
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
726 ((stringp link)
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
727 (idlwave-help-html-link link))
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
728
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
729 ;; Any extra help
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
730 (idlwave-extra-help-function
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
731 (idlwave-help-get-special-help name type class keyword))
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
732
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
733 ;; Nothing worked
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
734 (t (idlwave-help-error name type class keyword))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
735
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
736
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
737 (defun idlwave-help-get-special-help (name type class keyword)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
738 "Call the function given by `idlwave-extra-help-function'."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
739 (let* ((cw (selected-window))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
740 (help-pos (save-excursion
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
741 (set-buffer (idlwave-help-get-help-buffer))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
742 (let ((buffer-read-only nil))
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
743 (funcall idlwave-extra-help-function
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
744 name type class keyword)))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
745 (if help-pos
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
746 (idlwave-help-display-help-window help-pos)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
747 (idlwave-help-error name type class keyword))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
748 (select-window cw)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
749
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
750 (defun idlwave-help-html-link (link)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
751 "Get html help on a given LINK."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
752 (let ((browse-url-browser-function idlwave-help-browser-function)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
753 (help-loc (idlwave-html-help-location))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
754 (browse-url-generic-program idlwave-help-browser-generic-program)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
755 ;(browse-url-generic-args idlwave-help-browser-generic-args)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
756 full-link)
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
757
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
758 (unless idlwave-help-browse-url-available
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
759 (error "browse-url is not available -- install it to use HTML help."))
62121
9d18baf82550 (idlwave-do-context-help1, idlwave-highlight-linked-completions): Replace
Juanma Barranquero <lekktu@gmail.com>
parents: 61394
diff changeset
760
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
761 (if (and (memq system-type '(ms-dos windows-nt))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
762 idlwave-help-use-hh)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
763 (progn
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
764 (setq browse-url-browser-function 'browse-url-generic
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
765 full-link (concat (expand-file-name "idl.chm" help-loc)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
766 "::/"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
767 link))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
768 (if (memq 'keyhh idlwave-help-use-hh)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
769 (setq browse-url-generic-program "KEYHH"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
770 browse-url-generic-args '("-IDLWAVE"))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
771 (setq browse-url-generic-program "HH")))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
772 ;; Just a regular file name (+ anchor name)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
773 (unless (and (stringp help-loc)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
774 (file-directory-p help-loc))
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
775 (error
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
776 "Invalid help location; customize `idlwave-html-help-location'."))
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
777 (setq full-link (concat
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
778 "file://"
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
779 (expand-file-name
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
780 link
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
781 (expand-file-name "idl_html_help" help-loc)))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
782
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
783 ;; Check for a local browser
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
784 (if (or idlwave-help-browser-is-local
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
785 (string-match "w3" (symbol-name idlwave-help-browser-function)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
786 (idlwave-help-display-help-window '(lambda () (browse-url full-link)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
787 (browse-url full-link))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
788
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
789 ;; A special help routine for source-level syntax help in files.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
790 (defvar idlwave-help-fontify-source-code)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
791 (defvar idlwave-help-source-try-header)
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
792 (defvar idlwave-current-tags-buffer)
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
793 (defvar idlwave-current-tags-class)
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
794 (defun idlwave-help-with-source (name type class keyword)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
795 "Provide help for routines not documented in the IDL manuals. Works
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
796 by loading the routine source file into the help buffer. Depending on
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
797 the value of `idlwave-help-source-try-header', it attempts to show the
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
798 routine definition or the header description. If
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
799 `idlwave-help-do-class-struct-tag' is non-nil, keyword is a tag to
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
800 show help on from the class definition structure. If
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
801 `idlwave-help-do-struct-tag' is non-nil, show help from the matching
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
802 structure tag definition.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
803
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
804 This function can be used as `idlwave-extra-help-function'."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
805 (let* ((class-struct-tag idlwave-help-do-class-struct-tag)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
806 (struct-tag idlwave-help-do-struct-tag)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
807 (case-fold-search t)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
808 (real-class (if (consp name) (cdr name)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
809 (name (if (consp name) (car name) name))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
810 (class-only (and (stringp class) (not (stringp name))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
811 file header-pos def-pos in-buf)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
812 (if class-only ;Help with class? Using "Init" as source.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
813 (setq name "Init"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
814 type 'fun))
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
815 (if (not struct-tag)
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
816 (setq file
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
817 (idlwave-routine-source-file
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
818 (nth 3 (idlwave-best-rinfo-assoc
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
819 name (or type t) class (idlwave-routines))))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
820 (setq idlwave-help-def-pos nil
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
821 idlwave-help-args (list name type class keyword)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
822 idlwave-help-in-header nil
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
823 idlwave-help-do-struct-tag nil
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
824 idlwave-help-do-class-struct-tag nil)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
825 (if (or struct-tag (stringp file))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
826 (progn
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
827 (setq in-buf ; structure-tag completion is always in current buffer
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
828 (if struct-tag
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
829 idlwave-current-tags-buffer
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
830 (idlwave-get-buffer-visiting file)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
831 ;; see if file is in a visited buffer, insert those contents
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
832 (if in-buf
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
833 (progn
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
834 (setq file (buffer-file-name in-buf))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
835 (erase-buffer)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
836 (insert-buffer in-buf))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
837 (if (file-exists-p file) ;; otherwise just load the file
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
838 (progn
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
839 (erase-buffer)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
840 (insert-file-contents file nil nil nil 'replace))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
841 (idlwave-help-error name type class keyword)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
842 (if (and idlwave-help-fontify-source-code (not in-buf))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
843 (idlwave-help-fontify)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
844 (idlwave-help-error name type class keyword))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
845 (setq idlwave-help-mode-line-indicator file)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
846
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
847 ;; Try to find a good place to display
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
848 (setq def-pos
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
849 ;; Find the class structure tag if that's what we're after
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
850 (cond
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
851 ;; Class structure tags: find the class or named structure
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
852 ;; definition
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
853 (class-struct-tag
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
854 (save-excursion
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
855 (setq class
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
856 (if (string-match "[a-zA-Z0-9]\\(__\\)" name)
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
857 (substring name 0 (match-beginning 1))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
858 idlwave-current-tags-class))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
859 (and
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
860 (idlwave-find-class-definition class nil real-class)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
861 (idlwave-find-struct-tag keyword))))
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
862
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
863 ;; Generic structure tags: the structure definition
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
864 ;; location within the file has been recorded in
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
865 ;; `struct-tag'
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
866 (struct-tag
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
867 (save-excursion
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
868 (and
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
869 (integerp struct-tag)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
870 (goto-char struct-tag)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
871 (idlwave-find-struct-tag keyword))))
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
872
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
873 ;; Just find the routine definition
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
874 (t
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
875 (if class-only (point-min)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
876 (idlwave-help-find-routine-definition name type class keyword))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
877 idlwave-help-def-pos def-pos)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
878
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
879 (if (and idlwave-help-source-try-header
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
880 (not (or struct-tag class-struct-tag)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
881 ;; Check if we can find the header
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
882 (save-excursion
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
883 (goto-char (or def-pos (point-max)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
884 (setq header-pos (idlwave-help-find-in-doc-header
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
885 name type class keyword 'exact)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
886 idlwave-help-in-header header-pos)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
887
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
888 (if (or header-pos def-pos)
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
889 (progn
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
890 (if (boundp 'idlwave-help-min-frame-width)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
891 (setq idlwave-help-min-frame-width 80))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
892 (goto-char (or header-pos def-pos)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
893 (idlwave-help-error name type class keyword))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
894
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
895 (point)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
896
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
897
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
898 (defun idlwave-help-find-routine-definition (name type class keyword)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
899 "Find the definition of routine CLASS::NAME in current buffer.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
900 KEYWORD is ignored. Returns the point of match if successful, nil otherwise."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
901 (save-excursion
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
902 (goto-char (point-max))
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
903 (if (re-search-backward
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
904 (concat "^[ \t]*"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
905 (if (eq type 'pro) "pro"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
906 (if (eq type 'fun) "function"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
907 "\\(pro\\|function\\)"))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
908 "[ \t]+"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
909 (regexp-quote (downcase (idlwave-make-full-name class name)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
910 "[, \t\r\n]")
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
911 nil t)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
912 (match-beginning 0)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
913 nil)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
914
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
915 (defvar idlwave-doclib-start)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
916 (defvar idlwave-doclib-end)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
917 (defun idlwave-help-find-in-doc-header (name type class keyword
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
918 &optional exact)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
919 "Find the requested help in the doc-header above point.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
920
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
921 First checks if there is a doc-lib header which describes the correct
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
922 routine. Then tries to find the KEYWORDS section and the KEYWORD, if
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
923 given. Returns the point which should be window start of the help
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
924 window. If EXACT is non-nil, the full help position must be found -
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
925 down to the keyword requested. This setting is for context help, if
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
926 the exact spot is needed.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
927
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
928 If EXACT is nil, the position of the header is returned if it
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
929 describes the correct routine - even if the keyword description cannot
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
930 be found. TYPE is ignored.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
931
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
932 This function expects a more or less standard routine header. In
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
933 particlar it looks for the `NAME:' tag, either with a colon, or alone
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
934 on a line. Then `NAME:' must be followed by the routine name on the
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
935 same or the next line. When KEYWORD is non-nil, looks first for a
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
936 `KEYWORDS' section. It is amazing how inconsisten this is through
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
937 some IDL libraries I have seen. We settle for a line containing an
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
938 upper case \"KEYWORD\" string. If this line is not fould we search
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
939 for the keyword anyway to increase the hit-rate
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
940
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
941 When one of these sections exists we check for a line starting with any of
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
942
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
943 /KEYWORD KEYWORD- KEYWORD= KEYWORD
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
944
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
945 with spaces allowed between the keyword and the following dash or equal sign.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
946 If there is a match, we assume it is the keyword description."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
947 (let* ((case-fold-search t)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
948 (rname (if (stringp class)
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
949 (concat
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
950 "\\("
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
951 ;; Traditional name or class::name
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
952 "\\("
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
953 "\\(" (regexp-quote (downcase class)) "::\\)?"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
954 (regexp-quote (downcase name))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
955 "\\>\\)"
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
956 (concat
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
957 "\\|"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
958 ;; class__define or just class
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
959 (regexp-quote (downcase class)) "\\(__define\\)?")
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
960 "\\)")
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
961 (regexp-quote (downcase name))))
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
962
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
963 ;; NAME tag plus the routine name. The new version is from JD.
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
964 (name-re (concat
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
965 "\\(^;+\\*?[ \t]*"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
966 idlwave-help-doclib-name
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
967 "\\([ \t]*:\\|[ \t]*$\\)[ \t]*\\(\n;+[ \t]*\\)*"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
968 rname
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
969 "\\|"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
970 "^;+[ \t]*"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
971 rname
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
972 ":[ \t]*$\\)"))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
973
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
974 ;; Header start plus name
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
975 (header-re (concat "\\(" idlwave-doclib-start "\\).*\n"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
976 "\\(^;+.*\n\\)*"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
977 "\\(" name-re "\\)"))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
978 ;; A keywords section
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
979 (kwds-re (concat ; forgiving
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
980 "^;+\\*?[ \t]*"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
981 "\\([-A-Z_ ]*"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
982 idlwave-help-doclib-keyword
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
983 "[-A-Z_ ]*\\)"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
984 "\\(:\\|[ \t]*\n\\)"))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
985
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
986 ;; The individual keyword description line.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
987 (kwd-re (if keyword ; hard (well...)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
988 (concat
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
989 "^;+[ \t]+"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
990 "\\(/" (regexp-quote (upcase keyword))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
991 "\\|" (regexp-quote (upcase keyword)) "[ \t]*[-=:\n]"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
992 "\\)")))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
993 (kwd-re2 (if keyword ; forgiving
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
994 (concat
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
995 "^;+[ \t]+"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
996 (regexp-quote (upcase keyword))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
997 "\\>")))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
998 dstart dend name-pos kwds-pos kwd-pos)
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
999 (catch 'exit
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1000 (save-excursion
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1001 (goto-char (point-min))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1002 (while (and (setq dstart (re-search-forward idlwave-doclib-start nil t))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1003 (setq dend (re-search-forward idlwave-doclib-end nil t)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1004 ;; found a routine header
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1005 (goto-char dstart)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1006 (if (setq name-pos (re-search-forward name-re dend t))
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
1007 (progn
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1008 (if keyword
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1009 ;; We do need a keyword
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1010 (progn
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1011 ;; Try to find a keyword section, but don't force it.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1012 (goto-char name-pos)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1013 (if (let ((case-fold-search nil))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1014 (re-search-forward kwds-re dend t))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1015 (setq kwds-pos (match-beginning 0)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1016 ;; Find the keyword description
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1017 (if (or (let ((case-fold-search nil))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1018 (re-search-forward kwd-re dend t))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1019 (re-search-forward kwd-re dend t)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1020 (let ((case-fold-search nil))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1021 (re-search-forward kwd-re2 dend t))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1022 (re-search-forward kwd-re2 dend t))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1023 (setq kwd-pos (match-beginning 0))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1024 (if exact
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1025 (progn
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1026 (idlwave-help-diagnostics
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1027 (format "Could not find description of kwd %s"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1028 (upcase keyword)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1029 (throw 'exit nil))))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1030 ;; Return the best position we got
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1031 (throw 'exit (or kwd-pos kwds-pos name-pos dstart)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1032 (goto-char dend))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1033 (idlwave-help-diagnostics "Could not find doclib header")
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1034 (throw 'exit nil))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1035
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1036 (defun idlwave-help-diagnostics (string &optional ding)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1037 "Add a diagnostics string to the list.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1038 When DING is non-nil, ring the bell as well."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1039 (if (boundp 'idlwave-help-diagnostics)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1040 (progn
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1041 (setq idlwave-help-diagnostics
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1042 (cons string idlwave-help-diagnostics))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1043 (if ding (ding)))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1044
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1045 (defun idlwave-help-toggle-header-top-and-def (arg)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1046 (interactive "P")
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1047 (let (pos)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1048 (if idlwave-help-in-header
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1049 ;; Header was the last thing displayed
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1050 (progn
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1051 (setq idlwave-help-in-header nil)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1052 (setq pos idlwave-help-def-pos))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1053 ;; Try to display header
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1054 (setq pos (idlwave-help-find-in-doc-header
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1055 (nth 0 idlwave-help-args)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1056 (nth 1 idlwave-help-args)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1057 (nth 2 idlwave-help-args)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1058 nil))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1059 (if pos
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1060 (setq idlwave-help-in-header t)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1061 (error "Cannot find doclib header for routine %s"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1062 (idlwave-make-full-name (nth 2 idlwave-help-args)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1063 (nth 0 idlwave-help-args)))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1064 (if pos
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1065 (progn
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1066 (goto-char pos)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1067 (recenter 0)))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1068
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1069 (defun idlwave-help-find-first-header (arg)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1070 (interactive "P")
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1071 (let (pos)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1072 (save-excursion
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1073 (goto-char (point-min))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1074 (if (re-search-forward idlwave-doclib-start nil t)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1075 (setq pos (match-beginning 0))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1076 (if pos
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1077 (progn
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1078 (goto-char pos)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1079 (recenter 0))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1080 (error "No DocLib Header in current file"))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1081
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1082 (defun idlwave-help-find-header (arg)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1083 "Jump to the DocLib Header."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1084 (interactive "P")
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1085 (if arg
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1086 (idlwave-help-find-first-header nil)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1087 (setq idlwave-help-in-header nil)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1088 (idlwave-help-toggle-header-match-and-def arg 'top)))
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
1089
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1090 (defun idlwave-help-toggle-header-match-and-def (arg &optional top)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1091 (interactive "P")
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1092 (let ((args idlwave-help-args)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1093 pos)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1094 (if idlwave-help-in-header
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1095 ;; Header was the last thing displayed
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1096 (progn
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1097 (setq idlwave-help-in-header nil)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1098 (setq pos idlwave-help-def-pos))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1099 ;; Try to display header
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1100 (setq pos (apply 'idlwave-help-find-in-doc-header
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
1101 (if top
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1102 (list (car args) (nth 1 args) (nth 2 args) nil)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1103 args)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1104 (if pos
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1105 (setq idlwave-help-in-header t)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1106 (error "Cannot find doclib header for routine %s"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1107 (idlwave-make-full-name (nth 2 idlwave-help-args)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1108 (nth 0 idlwave-help-args)))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1109 (if pos
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1110 (progn
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1111 (goto-char pos)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1112 (recenter 0)))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1113
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1114 (defvar font-lock-verbose)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1115 (defvar idlwave-mode-syntax-table)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1116 (defvar idlwave-font-lock-defaults)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1117 (defun idlwave-help-fontify ()
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1118 "Fontify the Help buffer as source code.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1119 Useful when source code is displayed as help. See the option
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1120 `idlwave-help-fontify-source-code'."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1121 (interactive)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1122 (if (featurep 'font-lock)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1123 (let ((major-mode 'idlwave-mode)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1124 (font-lock-verbose
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1125 (if (interactive-p) font-lock-verbose nil))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1126 (syntax-table (syntax-table)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1127 (unwind-protect
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1128 (progn
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1129 (set-syntax-table idlwave-mode-syntax-table)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1130 (set (make-local-variable 'font-lock-defaults)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1131 idlwave-font-lock-defaults)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1132 (font-lock-fontify-buffer))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1133 (set-syntax-table syntax-table)))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1134
64001
82d080bf4f42 Updated to IDLWAVE v5.7 (see idlwave.org), and variable cleanup
J.D. Smith <jdsmith@as.arizona.edu>
parents: 63450
diff changeset
1135
58295
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1136 (defun idlwave-help-error (name type class keyword)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1137 (error "Can't find help on %s%s %s"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1138 (or (and (or class name) (idlwave-make-full-name class name))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1139 "<unknown>")
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1140 (if keyword (format ", keyword %s" (upcase keyword)) "")
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1141 (if idlwave-html-help-location
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1142 ""
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1143 "(help location unknown)")))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1144
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1145 (defun idlwave-help-show-help-frame ()
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1146 "Show the help frame, creating it if necessary"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1147 ;; Use a special frame for this
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1148 (unless (frame-live-p idlwave-help-frame)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1149 (setq idlwave-help-frame
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1150 (make-frame idlwave-help-frame-parameters))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1151 ;; Strip menubar (?) and toolbar from the Help frame.
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1152 (if (fboundp 'set-specifier)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1153 (progn
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1154 ;; XEmacs
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1155 (let ((sval (cons idlwave-help-frame nil)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1156 ;; (set-specifier menubar-visible-p sval)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1157 (set-specifier default-toolbar-visible-p sval)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1158 ;; Emacs
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1159 (modify-frame-parameters idlwave-help-frame
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1160 '(;;(menu-bar-lines . 0)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1161 (tool-bar-lines . 0)))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1162 (select-frame idlwave-help-frame))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1163
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1164 (defun idlwave-help-get-help-buffer ()
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1165 "Return the IDLWAVE Help buffer. Make it first if necessary."
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1166 (let ((buf (get-buffer "*IDLWAVE Help*")))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1167 (if buf
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1168 nil
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1169 (setq buf (get-buffer-create "*IDLWAVE Help*"))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1170 (save-excursion
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1171 (set-buffer buf)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1172 (idlwave-help-mode)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1173 buf))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1174
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1175 (defun idlwave-grep (regexp list)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1176 (let (rtn)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1177 (while list
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1178 (if (string-match regexp (car list))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1179 (setq rtn (cons (car list) rtn)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1180 (setq list (cdr list)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1181 (nreverse rtn)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1182
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1183 (defun idlwave-entry-has-help (entry)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1184 (and entry (car (nth 5 entry))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1185
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1186 (defun idlwave-has-help (name type class)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1187 "Does this have help associated with it?"
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1188 (let ((entry (idlwave-best-rinfo-assoc name type class (idlwave-routines))))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1189 (idlwave-entry-has-help entry)))
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1190
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1191 (provide 'idlw-help)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1192 (provide 'idlwave-help)
fda404732a9a Initial checkin of HTML help support module.
J.D. Smith <jdsmith@as.arizona.edu>
parents:
diff changeset
1193
58296
4773953f1a10 Restore arch taglines
Miles Bader <miles@gnu.org>
parents: 58295
diff changeset
1194 ;; arch-tag: d27b5505-59de-497f-ba3f-f199fd4fb911
4773953f1a10 Restore arch taglines
Miles Bader <miles@gnu.org>
parents: 58295
diff changeset
1195 ;;; idlw-help.el ends here