summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Frankel <rick@rickster.com>2013-10-31 17:06:49 -0400
committerRick Frankel <rick@rickster.com>2013-10-31 17:34:54 -0400
commitcebf7d012dd17f58650f9867dd41ee99735c7fb5 (patch)
treece635b698481f0b2b050497dd5b3588eef3b5cdc
parente0011113b3e9211f3708a043da25a7307ae1cc54 (diff)
downloadorg-mode-cebf7d012dd17f58650f9867dd41ee99735c7fb5.tar.gz
org.el: Display images in link descriptions.
* lisp/org.el (org-display-inline-images): Modify link regular expression to match images in description part. Update doc string to explain link behavior.
-rw-r--r--lisp/org.el17
1 files changed, 11 insertions, 6 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 6cdbd44..c42b9eb 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -18794,11 +18794,16 @@ INCLUDE-LINKED is passed to `org-display-inline-images'."
(defun org-display-inline-images (&optional include-linked refresh beg end)
"Display inline images.
-Normally only links without a description part are inlined, because this
-is how it will work for export. When INCLUDE-LINKED is set, also links
-with a description part will be inlined. This can be nice for a quick
-look at those images, but it does not reflect what exported files will look
-like.
+Normally only links without a description part, or with an image
+file name in the description, are inlined, because this is how it
+will work for export. When INCLUDE-LINKED is set, also links
+with a text description part will be inlined. This can be nice
+for a quick look at those images, but it does not reflect what
+exported files will look like. Note that in latex and html
+exports, images specified in the description will only be treated
+as graphic if they begin with the 'file:' protocol. Images
+specified in the description without a protocol will be displayed
+inline in the buffer, but shown as text in the export.
When REFRESH is set, refresh existing images between BEG and END.
This will create new image displays only if necessary.
BEG and END default to the buffer boundaries."
@@ -18812,7 +18817,7 @@ BEG and END default to the buffer boundaries."
(widen)
(setq beg (or beg (point-min)) end (or end (point-max)))
(goto-char beg)
- (let ((re (concat "\\[\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?"
+ (let ((re (concat "\\[.*\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?"
(substring (org-image-file-name-regexp) 0 -2)
"\\)\\]" (if include-linked "" "\\]")))
(case-fold-search t)