0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-30 17:03:09 +00:00

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.
This commit is contained in:
Rick Frankel 2013-10-31 17:06:49 -04:00
parent e0011113b3
commit cebf7d012d

View file

@ -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)