Function: Info-display-images-node

Info-display-images-node is a byte-compiled function defined in info.el.gz.

Signature

(Info-display-images-node)

Documentation

Display images in current node.

Source Code

;; Defined in /usr/src/emacs/lisp/info.el.gz
(defun Info-display-images-node ()
  "Display images in current node."
  (save-excursion
    (let ((inhibit-read-only t)
	  (case-fold-search t))
      (goto-char (point-min))
      (while (re-search-forward
	      "\\(\0\b[[]image\\(\\(?:[^\b]\\|[^\0]+\b\\)*\\)\0\b[]]\\)"
	      nil t)
	(let* ((start (match-beginning 1))
	       (parameter-alist (Info-split-parameter-string (match-string 2)))
               (src (cdr (assoc-string "src" parameter-alist))))
          (if (display-images-p)
              (let* ((image-file (if src (if (file-name-absolute-p src) src
                                           (concat default-directory src))
                                   ""))
                     (image (if (file-exists-p image-file)
                                (create-image image-file)
                              (or (cdr (assoc-string "text" parameter-alist))
				  (and src (concat "[broken image:" src "]"))
				  "[broken image]"))))
                (if (not (get-text-property start 'display))
                    (add-text-properties
                     start (point)
		     `(display ,image rear-nonsticky (display)
		       help-echo ,(cdr (assoc-string "alt" parameter-alist))))))
            ;; text-only display, show alternative text if provided, or
            ;; otherwise a clue that there's meant to be a picture
            (delete-region start (point))
            (insert (or (cdr (assoc-string "text" parameter-alist))
                        (cdr (assoc-string "alt" parameter-alist))
                        (and src (concat "[image:" src "]"))
                        "[image]"))))))
    (set-buffer-modified-p nil)))