From 2ae77c5e50912f5ccf85d4e72bf1fb5b0b504478 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Fri, 27 Jun 2014 17:28:56 +0200 Subject: [PATCH] org-element: Fix parsing path starting with ~ * lisp/org-element.el (org-element-link-parser): Do not prepend "//" to paths starting with "~". Since b1dcd0fb0bec6b523c900bc1304fbe834c21697d, link parser doesn't expand file names anymore. We need to prevent it from "fixing" paths starting with "~", as it can cause trouble to some exporters (e.g. latex). --- lisp/org-element.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/org-element.el b/lisp/org-element.el index bb38d96c9..242c97f7e 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -3053,8 +3053,8 @@ Assume point is at the beginning of the link." (setq search-option (match-string 1 path) path (replace-match "" nil nil path))) ;; Normalize URI. - (when (and (not (org-string-match-p "\\`//" path)) - (file-name-absolute-p path)) + (when (and (file-name-absolute-p path) + (not (org-string-match-p "\\`[/~]/" path))) (setq path (concat "//" path))) ;; Make sure TYPE always reports "file". (setq type "file"))