From 80b81a168e17be8119d92aad102d2062d7411747 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Tue, 10 Nov 2009 08:48:40 +0100 Subject: [PATCH] LaTeX export: Fix protection bug Sebastian Rose writes: > The following code does not work as expected, when exported to PDF: > > => --->8----------------------------->8----------------------------->8--- > * Image basics > > Images are inserted into an Org file in a fashion similar to links: > : [[file:///home/sebastian/develop/org/org-mode-unicorn.png]] > > <= ---8<-----------------------------8<-----------------------------8<--- > > Result: > > The last line is exported as: > > \href{file:///home/sebastian/develop/org/org-mode-unicorn.png}{nil} > > > Expected result: > > I expect the last line to be exported as fixed width text. > --- lisp/ChangeLog | 3 +++ lisp/org-latex.el | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1706a5a80..82545df33 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2009-11-10 Carsten Dominik + * org-latex.el (org-export-latex-links): Check for protectedness + in the last matched character, not after the match. + * org-datetree.el (org-datetree-find-date-create): Respect restriction when KEEP-RESTRICTION is set. (org-datetree-file-entry-under): New function. diff --git a/lisp/org-latex.el b/lisp/org-latex.el index 984a09ea0..c041d61d8 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -1536,7 +1536,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." "Convert links to LaTeX." (goto-char (point-min)) (while (re-search-forward org-bracket-link-analytic-regexp++ nil t) - (org-if-unprotected + (org-if-unprotected-1 (goto-char (match-beginning 0)) (let* ((re-radio org-export-latex-all-targets-re) (remove (list (match-beginning 0) (match-end 0)))