1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-29 07:58:21 +00:00

org-element: Fix parsing path starting with ~

* lisp/org-element.el (org-element-link-parser): Do not prepend "//"
  to paths starting with "~".

Since b1dcd0fb0b, 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).
This commit is contained in:
Nicolas Goaziou 2014-06-27 17:28:56 +02:00
parent 16c71d6b78
commit 2ae77c5e50

View File

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