Function: idlwave-do-mouse-completion-help

idlwave-do-mouse-completion-help is a byte-compiled function defined in idlw-help.el.gz.

Signature

(idlwave-do-mouse-completion-help EV)

Documentation

Display online help on an item in the *Completions* buffer.

Needs additional info stored in global idlwave-completion-help-info.

Source Code

;; Defined in /usr/src/emacs/lisp/obsolete/idlw-help.el.gz
(defun idlwave-do-mouse-completion-help (ev)
  "Display online help on an item in the *Completions* buffer.
Needs additional info stored in global `idlwave-completion-help-info'."
  (let* ((cw (selected-window))
	 (info idlwave-completion-help-info) ; global passed in
	 (what (nth 0 info))
	 (idlw-help-name (nth 1 info))
	 (type (nth 2 info))
	 (class (nth 3 info))
	 (need-class class)
	 (idlw-help-kwd (nth 4 info))
	 (sclasses (nth 5 info))
	 word idlw-help-link)
    (mouse-set-point ev)


    ;; See if we can also find help somewhere, e.g. for multiple classes
    (setq word (idlwave-this-word))
    (if (string= word "")
	(error "No help item selected"))
    (setq idlw-help-link (get-text-property 0 'link word))
    (select-window cw)
    (cond
     ;; Routine name
     ((memq what '(procedure function routine))
      (setq idlw-help-name word)
      (if (or (eq class t)
	      (and (stringp class) sclasses))
	  (let* ((classes (idlwave-all-method-classes
			   (idlwave-sintern-method idlw-help-name)
			   type)))
	    (setq idlw-help-link t)		; No specific link valid yet
	    (if sclasses
		(setq classes (idlwave-members-only
			       classes (cons class sclasses))))
	    (setq class (idlwave-popup-select ev classes
					      "Select Class" 'sort))))

      ;; XXX is this necessary, given all-method-classes?
      (if (stringp class)
	  (setq class (idlwave-find-inherited-class
		       (idlwave-sintern-routine-or-method idlw-help-name class)
		       type (idlwave-sintern-class class)))))

     ;; Keyword
     ((eq what 'keyword)
      (setq idlw-help-kwd word)
      (if (or (eq class t)
	      (and (stringp class) sclasses))
	  (let ((classes  (idlwave-all-method-keyword-classes
			   (idlwave-sintern-method idlw-help-name)
			   (idlwave-sintern-keyword idlw-help-kwd)
			   type)))
	    (setq idlw-help-link t) ; Link can't be correct yet
	    (if sclasses
		(setq classes (idlwave-members-only
			       classes (cons class sclasses))))
	    (setq class (idlwave-popup-select ev classes
					      "Select Class" 'sort))
	    ;; XXX is this necessary, given all-method-keyword-classes?
	    (if (stringp class)
		(setq class (idlwave-find-inherited-class
			     (idlwave-sintern-routine-or-method
			      idlw-help-name class)
			     type (idlwave-sintern-class class)))))
	(if (string= (downcase idlw-help-name) "obj_new")
	    (setq class idlwave-current-obj_new-class
		  idlw-help-name "Init"))))

     ;; Class name
     ((eq what 'class)
      (setq class word
	    word nil))

     ;; A special named function to call which sets some of our variables
     ((and (symbolp what)
	   (fboundp what))
      (funcall what 'set word))

     (t (error "Cannot help with this item")))
    (if (and need-class (not class)
	     (not (and idlw-help-link (not (eq idlw-help-link t)))))
	(error "Cannot help with this item"))
    (idlwave-online-help idlw-help-link (or idlw-help-name word)
			 type class idlw-help-kwd)))