On 2013-10-31 06:04, Alan Schmitt wrote:
r...@rickster.com writes:

So it turns out that this is a REALLY simple patch (two characters):

+++ b/lisp/org.el
@@ -18853,7 +18853,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)

This seems to work in all cases I can think of (see test file below).
Let me know if this works for you and i will apply to master when i
get home and have git push access.

I tried it on some files with images as links, and it works
great. Thanks a lot!

So, I've done some testing of the export functions (html and latex
only) and found the following behaviors with this patch:

- HTML
- image in description only displayed if the protocol (file:) is
included.
- LaTeX
- same, required file: protocol in description
- additionally, pdflatex \includgraphics barfs on any path w/ a
=./= path prefix -- this is true for the current implmenation as
well.

Changing the regexp for in-buffer image expansion to mimic the export
behavior is difficult at best. I think the inconsistency is
acceptable, and I will documentment the behavior in the
`org-display-inline-images' docstring.

The latex breakage on paths beginning with =./= should perhaps be
addressed in the latex exporter, but this is orthogonal to the
current issue.

If there is no objection, I will push a fix tonight or tomorrow.

rick


Reply via email to