From 570083d2ad043dde96d85c84dbfbd81928747141 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Thu, 27 Sep 2012 23:30:52 +0200 Subject: [PATCH] org.el (org-display-inline-images): Search for #+ATTR within the current paragraph * org.el (org-display-inline-images): Search for #+ATTR within the current paragraph. --- lisp/org.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 1eeb41234..d033253e3 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -17961,9 +17961,11 @@ BEG and END default to the buffer boundaries." (null org-image-actual-width)) (save-excursion (save-match-data - (move-beginning-of-line 0) - (if (looking-at "#\\+ATTR.*width=\"\\([^\"]+\\)\"") - (string-to-number (match-string 1)))))) + (when (re-search-backward + "#\\+ATTR.*width=\"\\([^\"]+\\)\"" + (save-excursion + (re-search-backward "^[ \t]*$\\|\\`" nil t)) t) + (string-to-number (match-string 1)))))) width (cond ((eq org-image-actual-width t) nil) ((null org-image-actual-width) attrwidth) ((numberp org-image-actual-width)