Function: apropos-print-doc

apropos-print-doc is a byte-compiled function defined in apropos.el.gz.

Signature

(apropos-print-doc APROPOS-ITEM I TYPE DO-KEYS)

Source Code

;; Defined in /usr/src/emacs/lisp/apropos.el.gz
    (setq apropos-accumulator ())))	; permit gc

(defun apropos-print-doc (apropos-item i type do-keys)
  (let ((doc (nth i apropos-item)))
    (when (stringp doc)
      (if apropos-compact-layout
          (insert (propertize "\t" 'display '(space :align-to 32)))
        (insert " "))
      (if apropos-multi-type
	  (let ((button-face (button-type-get type 'face)))
	    (unless (consp button-face)
	      (setq button-face (list button-face)))
            (insert " ")
	    (insert-text-button
	     (if apropos-compact-layout
		 (format "<%s>" (button-type-get type 'apropos-short-label))
	       (button-type-get type 'apropos-label))
	     'type type
	     'apropos-symbol (car apropos-item))
	    (insert (if apropos-compact-layout " " ": ")))

	;; If the query is only for a single type, there's no point
	;; writing it over and over again.  Insert a blank button, and
	;; put the 'apropos-label property there (needed by
	;; apropos-symbol-button-display-help).
	(insert-text-button
	 " " 'type type 'skip t
	 'face 'default 'apropos-symbol (car apropos-item)))

      (let ((opoint (point))
	    (ocol (current-column)))
	(cond ((equal doc "")
	       (setq doc "(not documented)"))
	      (do-keys
	       (setq doc (or (ignore-errors
                               (substitute-command-keys doc))
                             doc))))
	(insert doc)
	(if (equal doc "(not documented)")
	    (put-text-property opoint (point) 'font-lock-face 'shadow))
	;; The labeling buttons might make the line too long, so fill it if
	;; necessary.
	(let ((fill-column (+ 5 (if (integerp emacs-lisp-docstring-fill-column)
                                    emacs-lisp-docstring-fill-column
                                  fill-column)))
	      (fill-prefix (make-string ocol ?\s)))
	  (fill-region opoint (point) nil t)))
      (or (bolp) (terpri)))))