From 96727100a742577ce0188d6d91b464b216e924b4 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Fri, 6 Sep 2013 23:43:49 +0300 Subject: [PATCH] * lisp/info.el (Info-display-images-node): When image file doesn't exist display text version of the image if it's provided in the Info file. Otherwise, display the location of missing image from SRC attribute. Add help-echo text property from ALT attribute. Fixes: debbugs:15279 --- lisp/ChangeLog | 7 +++++++ lisp/info.el | 11 +++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 53335cb6311..ca487ad2fef 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2013-09-06 Juri Linkov + + * info.el (Info-display-images-node): When image file doesn't exist + display text version of the image if it's provided in the Info file. + Otherwise, display the location of missing image from SRC attribute. + Add help-echo text property from ALT attribute. (Bug#15279) + 2013-09-06 Stefan Monnier * abbrev.el (edit-abbrevs-mode-map): Rename from edit-abbrevs-map. diff --git a/lisp/info.el b/lisp/info.el index 182ad8563aa..65cd7eddcfd 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -1595,17 +1595,20 @@ escaped (\\\",\\\\)." "")) (image (if (file-exists-p image-file) (create-image image-file) - "[broken image]"))) + (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))))) + 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 "]")) + (and src (concat "[image:" src "]")) "[image]")))))) (set-buffer-modified-p nil))) -- 2.39.2