• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/emacs-93/emacs/lisp/progmodes/

Lines Matching defs:idlwave

38 ;;           http://idlwave.org
46 (defvar idlwave-help-browse-url-available nil
49 (setq idlwave-help-browse-url-available
54 (defgroup idlwave-online-help nil
56 :group 'idlwave)
58 (defcustom idlwave-html-help-pre-v6 nil
60 :group 'idlwave-online-help
63 (defvar idlwave-html-link-sep
64 (if idlwave-html-help-pre-v6 "#" "#wp"))
66 (defcustom idlwave-html-system-help-location "help/online_help/"
67 "The directory, relative to idlwave-system-directory, where the idl
69 is used in preference to the old idlwave-html-help-location."
70 :group 'idlwave-online-help
73 (defcustom idlwave-html-help-location
78 6.2 or later (see idlwave-html-system-help-location)."
79 :group 'idlwave-online-help
82 (defvar idlwave-help-use-hh nil
85 (defcustom idlwave-help-use-assistant t
87 :group 'idlwave-online-help
90 (defcustom idlwave-help-browser-function browse-url-browser-function
93 :group 'idlwave-online-help
96 (defcustom idlwave-help-browser-generic-program browse-url-generic-program
98 :group 'idlwave-online-help
103 (defcustom idlwave-help-browser-generic-args
107 :group 'idlwave-online-help
110 (defcustom idlwave-help-browser-is-local nil
116 `idlwave-help-use-dedicated-frame' to function."
117 :group 'idlwave-online-help
120 (defvar idlwave-help-directory ""
121 "Obsolete variable. See idlwave-html-help-location.")
123 (defcustom idlwave-help-use-dedicated-frame t
125 :group 'idlwave-online-help
128 (defcustom idlwave-help-frame-parameters
131 See also `idlwave-help-use-dedicated-frame'.
134 :group 'idlwave-online-help
138 (defcustom idlwave-max-popup-menu-items 20
141 :group 'idlwave-online-help
144 (defcustom idlwave-extra-help-function 'idlwave-help-with-source
154 `idlwave-help-mode-line-indicator' should be set to a useful string,
156 should also set the variable `idlwave-help-min-frame-width' to a
165 The default value for this function is `idlwave-help-with-source' which
169 :group 'idlwave-online-help
172 (defcustom idlwave-help-fontify-source-code nil
174 :group 'idlwave-online-help
177 (defcustom idlwave-help-source-try-header t
184 :group 'idlwave-online-help
188 (defcustom idlwave-help-doclib-name "name"
192 :group 'idlwave-online-help
195 (defcustom idlwave-help-doclib-keyword "KEYWORD"
199 :group 'idlwave-online-help
202 (defface idlwave-help-link
206 :group 'idlwave-online-help)
208 (defvar idlwave-help-activate-links-aggressively nil
211 (defvar idlwave-completion-help-info)
213 (defvar idlwave-help-frame nil
215 (defvar idlwave-help-frame-width 102
218 (defvar idlwave-html-help-is-available nil
221 (defvar idlwave-help-mode-line-indicator ""
222 "Used for the special mode line in the idlwave-help-mode.")
224 (defvar idlwave-help-window-configuration nil)
225 (defvar idlwave-help-special-topic-words nil) ; defined by get_rinfo
229 (defvar idlwave-help-mode-map (make-sparse-keymap)
230 "The keymap used in idlwave-help-mode.")
232 (define-key idlwave-help-mode-map "q" 'idlwave-help-quit)
233 (define-key idlwave-help-mode-map "w" 'widen)
234 (define-key idlwave-help-mode-map "\C-m" (lambda (arg)
237 (define-key idlwave-help-mode-map " " 'scroll-up)
238 (define-key idlwave-help-mode-map [delete] 'scroll-down)
239 (define-key idlwave-help-mode-map "h" 'idlwave-help-find-header)
240 (define-key idlwave-help-mode-map "H" 'idlwave-help-find-first-header)
241 (define-key idlwave-help-mode-map "." 'idlwave-help-toggle-header-match-and-def)
242 (define-key idlwave-help-mode-map "F" 'idlwave-help-fontify)
243 (define-key idlwave-help-mode-map "\M-?" 'idlwave-help-return-to-calling-frame)
244 (define-key idlwave-help-mode-map "x" 'idlwave-help-return-to-calling-frame)
249 idlwave-help-menu idlwave-help-mode-map
252 ["Definition <-> Help Text" idlwave-help-toggle-header-match-and-def t]
253 ["Find DocLib Header" idlwave-help-find-header t]
254 ["Find First DocLib Header" idlwave-help-find-first-header t]
255 ["Fontify help buffer" idlwave-help-fontify t]
257 ["Quit" idlwave-help-quit t]))
259 (defvar idlwave-help-def-pos)
260 (defvar idlwave-help-args)
261 (defvar idlwave-help-in-header)
263 (defun idlwave-help-mode ()
282 \\{idlwave-help-mode-map}"
285 (setq major-mode 'idlwave-help-mode
287 (use-local-map idlwave-help-mode-map)
288 (easy-menu-add idlwave-help-menu idlwave-help-mode-map)
295 ": " 'idlwave-help-mode-line-indicator
298 (set (make-local-variable 'idlwave-help-def-pos) nil)
299 (set (make-local-variable 'idlwave-help-args) nil)
300 (set (make-local-variable 'idlwave-help-in-header) nil)
301 (run-hooks 'idlwave-help-mode-hook))
303 (defun idlwave-html-help-location ()
306 idlwave-html-system-help-location (idlwave-sys-dir)))
307 (help-dir (or (and (stringp idlwave-html-help-location)
308 (> (length idlwave-html-help-location) 0)
309 idlwave-html-help-location)
318 (defvar idlwave-help-assistant-available nil)
320 (defun idlwave-help-check-locations ()
322 (let ((sys-dir (idlwave-sys-dir))
323 (help-loc (idlwave-html-help-location)))
328 "HTML help location not found: try setting `idlwave-system-directory' and/or `idlwave-html-help-location'."))
330 (when (and idlwave-help-use-assistant
331 (not (eq (idlwave-help-assistant-available) t)))
333 (setq idlwave-help-use-assistant nil)
334 (unless idlwave-help-browse-url-available
338 (defvar idlwave-current-obj_new-class)
339 (defvar idlwave-help-diagnostics)
340 (defvar idlwave-experimental)
341 (defvar idlwave-last-context-help-pos)
342 (defun idlwave-do-context-help (&optional arg)
343 "Wrapper around the call to idlwave-context-help1.
346 (idlwave-help-diagnostics nil))
350 (if (and idlwave-experimental
352 (equal idlwave-last-context-help-pos marker))
353 (idlwave-help-select-help-frame)
355 (setq idlwave-last-context-help-pos marker)
356 (idlwave-do-context-help1 arg)
357 (if idlwave-help-diagnostics
359 (nreverse idlwave-help-diagnostics)
362 (defvar idlwave-help-do-class-struct-tag nil)
363 (defvar idlwave-structtag-struct-location)
364 (defvar idlwave-help-do-struct-tag nil)
365 (defvar idlwave-system-variables-alist)
366 (defvar idlwave-executive-commands-alist)
367 (defvar idlwave-system-class-info)
368 (defun idlwave-do-context-help1 (&optional arg)
369 "The work-horse version of `idlwave-context-help', which see."
375 (let* ((idlwave-query-class nil)
376 (idlwave-force-class-query (equal arg '(4)))
382 idlwave-help-special-topic-words t))
385 (structtag (and (fboundp 'idlwave-complete-structure-tag)
396 (setq module (idlwave-what-module-find-class)
397 cw (nth 2 (idlwave-where))) ;what would we complete here?
399 (if (equal (idlwave-downcase-safe (car module)) "obj_new")
400 (let* ((bos (save-excursion (idlwave-beginning-of-statement)
405 idlwave-current-obj_new-class (match-string 1 str))
419 (entry (assq (idlwave-sintern-sysvar word)
420 idlwave-system-variables-alist))
424 (assq (idlwave-sintern-sysvartag tag)
428 (setq link (idlwave-substitute-link-target link
437 idlwave-executive-commands-alist t))))
442 (or (idlwave-in-quote) ; e.g. obj_new
448 (idlwave-sintern-class this-word)
449 idlwave-system-class-info))
459 (idlwave-class-or-superclass-with-tag
460 (nth 2 (idlwave-current-routine))
462 (setq found-in (idlwave-class-found-in class-with))
463 (if (assq (idlwave-sintern-class class-with)
464 idlwave-system-class-info)
466 (setq idlwave-help-do-class-struct-tag t)
481 (idlwave-prepare-structure-tag-completion var)
482 (setq idlwave-help-do-struct-tag
483 idlwave-structtag-struct-location
495 (setq keyword (idlwave-expand-keyword this-word module))
498 (idlwave-help-diagnostics
500 (idlwave-make-full-name (nth 2 module)
505 (idlwave-help-diagnostics
522 (setq keyword (idlwave-expand-keyword this-word module))
533 (apply 'idlwave-online-help mod1)
535 (apply 'idlwave-online-help mod2)
536 (error (apply 'idlwave-online-help mod3)))))
539 (apply 'idlwave-online-help mod1)
540 (error (apply 'idlwave-online-help mod2)))
542 (apply 'idlwave-online-help mod1)
545 (defun idlwave-do-mouse-completion-help (ev)
547 Needs additional info stored in global `idlwave-completion-help-info'."
549 (info idlwave-completion-help-info) ; global passed in
562 (setq word (idlwave-this-word))
573 (let* ((classes (idlwave-all-method-classes
574 (idlwave-sintern-method name)
578 (setq classes (idlwave-members-only
580 (setq class (idlwave-popup-select ev classes
585 (setq class (idlwave-find-inherited-class
586 (idlwave-sintern-routine-or-method name class)
587 type (idlwave-sintern-class class)))))
594 (let ((classes (idlwave-all-method-keyword-classes
595 (idlwave-sintern-method name)
596 (idlwave-sintern-keyword kwd)
600 (setq classes (idlwave-members-only
602 (setq class (idlwave-popup-select ev classes
606 (setq class (idlwave-find-inherited-class
607 (idlwave-sintern-routine-or-method name class)
608 type (idlwave-sintern-class class)))))
610 (setq class idlwave-current-obj_new-class
626 (idlwave-online-help link (or name word) type class kwd)))
628 (defvar idlwave-highlight-help-links-in-completion)
629 (defvar idlwave-completion-help-links)
630 (defun idlwave-highlight-linked-completions ()
632 Those words in `idlwave-completion-help-links' have links. The
633 `idlwave-help-link' face is used for this."
634 (if idlwave-highlight-help-links-in-completion
638 (props (list 'face 'idlwave-help-link))
639 (info idlwave-completion-help-info) ; global passed in
654 (if idlwave-completion-help-links
656 word idlwave-completion-help-links t))))
665 (add-hook 'idlwave-completion-setup-hook
666 'idlwave-highlight-linked-completions)
668 (defvar idlwave-help-return-frame nil
671 (defun idlwave-help-quit ()
674 (cond ((and idlwave-help-use-dedicated-frame
675 (eq (selected-frame) idlwave-help-frame))
676 (if (and idlwave-experimental
677 (frame-live-p idlwave-help-return-frame))
685 (select-frame idlwave-help-return-frame)
688 idlwave-help-return-frame))
690 (delete-frame idlwave-help-frame))
691 ((window-configuration-p idlwave-help-window-configuration)
692 (set-window-configuration idlwave-help-window-configuration)
694 (t (kill-buffer (idlwave-help-get-help-buffer)))))
699 (defun idlwave-help-display-help-window (&optional pos-or-func)
702 if passed as a function. See `idlwave-help-use-dedicated-frame'."
704 (buf (idlwave-help-get-help-buffer)))
705 (if (and window-system idlwave-help-use-dedicated-frame)
707 (idlwave-help-show-help-frame)
711 (setq idlwave-help-window-configuration
723 (defun idlwave-help-select-help-frame ()
725 (if (and (frame-live-p idlwave-help-frame)
726 (not (eq (selected-frame) idlwave-help-frame)))
728 (setq idlwave-help-return-frame (selected-frame))
729 (select-frame idlwave-help-frame))))
731 (defun idlwave-help-return-to-calling-frame ()
734 (if (and (frame-live-p idlwave-help-return-frame)
735 (not (eq (selected-frame) idlwave-help-return-frame)))
736 (select-frame idlwave-help-return-frame)))
738 (defun idlwave-online-help (link &optional name type class keyword)
746 (let ((entry (idlwave-best-rinfo-assoc name type class
747 (idlwave-routines) nil t)))
753 (idlwave-entry-find-keyword entry keyword)))))
755 (t (setq link (idlwave-entry-has-help entry))))
759 (setq entry (assq (idlwave-sintern-class class)
760 idlwave-system-class-info)
765 (idlwave-make-full-name class name))))))
770 (idlwave-help-html-link link))
773 (idlwave-extra-help-function
774 (idlwave-help-get-special-help name type class keyword))
777 (t (idlwave-help-error name type class keyword))))
780 (defun idlwave-help-get-special-help (name type class keyword)
781 "Call the function given by `idlwave-extra-help-function'."
784 (set-buffer (idlwave-help-get-help-buffer))
786 (funcall idlwave-extra-help-function
789 (idlwave-help-display-help-window help-pos)
790 (idlwave-help-error name type class keyword))
793 (defun idlwave-help-html-link (link)
795 (let ((browse-url-browser-function idlwave-help-browser-function)
796 (help-loc (idlwave-html-help-location))
797 (browse-url-generic-program idlwave-help-browser-generic-program)
798 ;(browse-url-generic-args idlwave-help-browser-generic-args)
809 (idlwave-help-use-assistant
810 (idlwave-help-assistant-open-link link))
812 ((or idlwave-help-browser-is-local
813 (string-match "w3" (symbol-name idlwave-help-browser-function)))
814 (idlwave-help-display-help-window '(lambda () (browse-url full-link))))
819 (defvar idlwave-help-fontify-source-code)
820 (defvar idlwave-help-source-try-header)
821 (defvar idlwave-current-tags-buffer)
822 (defvar idlwave-current-tags-class)
823 (defun idlwave-help-with-source (name type class keyword)
826 the value of `idlwave-help-source-try-header', it attempts to show the
828 `idlwave-help-do-class-struct-tag' is non-nil, keyword is a tag to
830 `idlwave-help-do-struct-tag' is non-nil, show help from the matching
833 This function can be used as `idlwave-extra-help-function'."
834 (let* ((class-struct-tag idlwave-help-do-class-struct-tag)
835 (struct-tag idlwave-help-do-struct-tag)
846 (idlwave-routine-source-file
847 (nth 3 (idlwave-best-rinfo-assoc
848 name (or type t) class (idlwave-routines))))))
849 (setq idlwave-help-def-pos nil
850 idlwave-help-args (list name type class keyword)
851 idlwave-help-in-header nil
852 idlwave-help-do-struct-tag nil
853 idlwave-help-do-class-struct-tag nil)
858 idlwave-current-tags-buffer
859 (idlwave-get-buffer-visiting file)))
870 (idlwave-help-error name type class keyword)))
872 (if (and idlwave-help-fontify-source-code (not in-buf))
873 (idlwave-help-fontify)))
874 (idlwave-help-error name type class keyword))
875 (setq idlwave-help-mode-line-indicator file)
888 idlwave-current-tags-class))
890 (idlwave-find-class-definition class nil real-class)
891 (idlwave-find-struct-tag keyword))))
901 (idlwave-find-struct-tag keyword))))
906 (idlwave-help-find-routine-definition name type class keyword))))
907 idlwave-help-def-pos def-pos)
909 (if (and idlwave-help-source-try-header
914 (setq header-pos (idlwave-help-find-in-doc-header
916 idlwave-help-in-header header-pos)))
920 (if (boundp 'idlwave-help-min-frame-width)
921 (setq idlwave-help-min-frame-width 80))
923 (idlwave-help-error name type class keyword))
928 (defun idlwave-help-find-routine-definition (name type class keyword)
939 (regexp-quote (downcase (idlwave-make-full-name class name)))
945 (defvar idlwave-doclib-start)
946 (defvar idlwave-doclib-end)
947 (defun idlwave-help-find-in-doc-header (name type class keyword
996 idlwave-help-doclib-name
1005 (header-re (concat "\\(" idlwave-doclib-start "\\).*\n"
1012 idlwave-help-doclib-keyword
1032 (while (and (setq dstart (re-search-forward idlwave-doclib-start nil t))
1033 (setq dend (re-search-forward idlwave-doclib-end nil t)))
1056 (idlwave-help-diagnostics
1063 (idlwave-help-diagnostics "Could not find doclib header")
1066 (defun idlwave-help-diagnostics (string &optional ding)
1069 (if (boundp 'idlwave-help-diagnostics)
1071 (setq idlwave-help-diagnostics
1072 (cons string idlwave-help-diagnostics))
1075 (defun idlwave-help-toggle-header-top-and-def (arg)
1078 (if idlwave-help-in-header
1081 (setq idlwave-help-in-header nil)
1082 (setq pos idlwave-help-def-pos))
1084 (setq pos (idlwave-help-find-in-doc-header
1085 (nth 0 idlwave-help-args)
1086 (nth 1 idlwave-help-args)
1087 (nth 2 idlwave-help-args)
1090 (setq idlwave-help-in-header t)
1092 (idlwave-make-full-name (nth 2 idlwave-help-args)
1093 (nth 0 idlwave-help-args)))))
1099 (defun idlwave-help-find-first-header (arg)
1104 (if (re-search-forward idlwave-doclib-start nil t)
1112 (defun idlwave-help-find-header (arg)
1116 (idlwave-help-find-first-header nil)
1117 (setq idlwave-help-in-header nil)
1118 (idlwave-help-toggle-header-match-and-def arg 'top)))
1120 (defun idlwave-help-toggle-header-match-and-def (arg &optional top)
1122 (let ((args idlwave-help-args)
1124 (if idlwave-help-in-header
1127 (setq idlwave-help-in-header nil)
1128 (setq pos idlwave-help-def-pos))
1130 (setq pos (apply 'idlwave-help-find-in-doc-header
1135 (setq idlwave-help-in-header t)
1137 (idlwave-make-full-name (nth 2 idlwave-help-args)
1138 (nth 0 idlwave-help-args)))))
1145 (defvar idlwave-mode-syntax-table)
1146 (defvar idlwave-font-lock-defaults)
1147 (defun idlwave-help-fontify ()
1150 `idlwave-help-fontify-source-code'."
1153 (let ((major-mode 'idlwave-mode)
1159 (set-syntax-table idlwave-mode-syntax-table)
1161 idlwave-font-lock-defaults)
1166 (defun idlwave-help-error (name type class keyword)
1168 (or (and (or class name) (idlwave-make-full-name class name))
1171 (if idlwave-html-help-location
1175 (defun idlwave-help-show-help-frame ()
1178 (unless (frame-live-p idlwave-help-frame)
1179 (setq idlwave-help-frame
1180 (make-frame idlwave-help-frame-parameters))
1185 (let ((sval (cons idlwave-help-frame nil)))
1189 (modify-frame-parameters idlwave-help-frame
1192 (select-frame idlwave-help-frame))
1194 (defun idlwave-help-get-help-buffer ()
1202 (idlwave-help-mode)))
1205 (defun idlwave-grep (regexp list)
1213 (defun idlwave-entry-has-help (entry)
1216 (defun idlwave-has-help (name type class)
1218 (let ((entry (idlwave-best-rinfo-assoc name type class (idlwave-routines))))
1219 (idlwave-entry-has-help entry)))
1222 (defvar idlwave-help-assistant-process nil)
1223 (defvar idlwave-help-assistant-socket nil)
1228 (defvar idlwave-help-assistant-command
1232 "The command, rooted at idlwave-system-directory, which invokes the
1235 (defun idlwave-help-assistant-available ()
1236 (if idlwave-help-assistant-available
1237 (eq idlwave-help-assistant-available t)
1238 (setq idlwave-help-assistant-available
1239 (if (file-executable-p (idlwave-help-assistant-command))
1243 (defun idlwave-help-assistant-command ()
1244 (expand-file-name idlwave-help-assistant-command (idlwave-sys-dir)))
1246 (defun idlwave-help-assistant-start (&optional full-link)
1248 (when (or (not idlwave-help-assistant-socket)
1249 (not (eq (process-status idlwave-help-assistant-socket) 'open)))
1250 (let* ((help-loc (idlwave-html-help-location))
1251 (command (idlwave-help-assistant-command))
1258 (if idlwave-help-assistant-socket
1259 (delete-process idlwave-help-assistant-socket))
1261 (setq idlwave-help-assistant-process
1265 (set-process-filter idlwave-help-assistant-process
1268 (unless (accept-process-output idlwave-help-assistant-process 15)
1272 (set-process-filter idlwave-help-assistant-process nil)
1273 (setq idlwave-help-assistant-socket
1276 (if (eq (process-status idlwave-help-assistant-socket) 'open)
1278 (process-send-string idlwave-help-assistant-socket
1281 (idlwave-help-assistant-close)
1284 (defun idlwave-help-assistant-raise ()
1285 (idlwave-help-assistant-start)
1286 (process-send-string idlwave-help-assistant-socket "raise\n"))
1288 (defun idlwave-help-assistant-open-link (&optional link)
1290 (let ((help-loc (idlwave-html-help-location))
1306 just-started (idlwave-help-assistant-start (if exists full-link)))
1310 (process-send-string idlwave-help-assistant-socket
1312 (process-send-string idlwave-help-assistant-socket
1314 (process-send-string idlwave-help-assistant-socket
1316 (idlwave-help-assistant-raise))
1318 (defvar idlwave-help-assistant-help-with-topic-history nil
1321 (defun idlwave-help-assistant-help-with-topic (&optional topic)
1326 (idlwave-routines)
1329 idlwave-system-routines)
1332 idlwave-executive-commands-alist)
1333 idlwave-system-class-info))
1335 (idlwave-completing-read
1338 'idlwave-help-assistant-help-with-topic-history)))
1340 (idlwave-help-assistant-open-link (concat topic ".html")))))
1342 (defun idlwave-help-assistant-close ()
1343 (when (and idlwave-help-assistant-process
1344 (eq (process-status idlwave-help-assistant-process) 'run))
1345 (when idlwave-help-assistant-socket
1346 (process-send-string idlwave-help-assistant-socket "quit\n")
1347 (delete-process idlwave-help-assistant-socket))
1348 (stop-process idlwave-help-assistant-process)
1349 (delete-process idlwave-help-assistant-process)
1350 (setq idlwave-help-assistant-socket nil
1351 idlwave-help-assistant-process nil)))
1355 (provide 'idlwave-help)