From 43c086f4f742ee4d1b4cad2895b27a5a80b5f375 Mon Sep 17 00:00:00 2001 From: Marco Wahl Date: Fri, 22 Nov 2019 11:29:26 +0100 Subject: [PATCH] org: restrict inline image display to narrowed part * lisp/org.el (org-display-inline-images): Clarify documentation and introduce the narrowing borders to the function. --- lisp/org.el | 221 ++++++++++++++++++++++++++-------------------------- 1 file changed, 112 insertions(+), 109 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index a9c0d8e71..90f222c8b 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -16661,120 +16661,123 @@ exported files will look like. When optional argument REFRESH is non-nil, refresh existing images between BEG and END. This will create new image displays -only if necessary. BEG and END default to the buffer -boundaries." +only if necessary. + +BEG and END define the considered part. They default to the +buffer boundaries with possible narrowing." (interactive "P") (when (display-graphic-p) (unless refresh (org-remove-inline-images) (when (fboundp 'clear-image-cache) (clear-image-cache))) - (org-with-point-at (or beg 1) - (let* ((case-fold-search t) - (file-extension-re (image-file-name-regexp)) - (link-abbrevs (mapcar #'car - (append org-link-abbrev-alist-local - org-link-abbrev-alist))) - ;; Check absolute, relative file names and explicit - ;; "file:" links. Also check link abbreviations since - ;; some might expand to "file" links. - (file-types-re - (format "\\[\\[\\(?:file%s:\\|attachment:\\|[./~]\\)\\|\\]\\[\\(