Function: idlwave-highlight-linked-completions

idlwave-highlight-linked-completions is a byte-compiled function defined in idlw-help.el.gz.

Signature

(idlwave-highlight-linked-completions)

Documentation

Highlight all completions for which help is available and attach link.

Those words in idlwave-completion-help-links have links. The idlwave-help-link face is used for this.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/idlw-help.el.gz
(defun idlwave-highlight-linked-completions ()
  "Highlight all completions for which help is available and attach link.
Those words in `idlwave-completion-help-links' have links.  The
`idlwave-help-link' face is used for this."
  (if idlwave-highlight-help-links-in-completion
      (with-current-buffer "*Completions*"
	(save-excursion
	  (let* ((case-fold-search t)
		 (props (list 'face 'idlwave-help-link))
		 (info idlwave-completion-help-info) ; global passed in
		 (what (nth 0 info))  ; what was completed, or a func
		 ;; (class (nth 3 info)) ; any class
		 word beg end doit)
	    (goto-char (point-min))
	    (re-search-forward "possible completions are:" nil t)
	    (while (re-search-forward "\\s-\\([A-Za-z0-9_.]+\\)\\(\\s-\\|\\'\\)"
				      nil t)
	      (setq beg (match-beginning 1) end (match-end 1)
		    word (match-string 1) doit nil)
	      ;; Call special completion function test
	      (if (and (symbolp what)
		       (fboundp what))
		  (setq doit (funcall what 'test word))
		;; Look for special link property passed in help-links
		(if idlwave-completion-help-links
		    (setq doit (assoc-string
				word idlwave-completion-help-links t))))
	      (when doit
		(if (consp doit)
		    (setq props (append props `(link ,(cdr doit)))))
		(let ((buffer-read-only nil))
		  (add-text-properties beg end props)))
	      (goto-char end)))))))