From 9872a32374189663808682a695cd0549ff37b54d Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Tue, 8 Mar 2016 01:43:44 -0500 Subject: org-link-edit--get-link-data: Unescape link text org-make-link-string will escape the link again when it's reinserted. --- org-link-edit.el | 4 ++-- test-org-link-edit.el | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/org-link-edit.el b/org-link-edit.el index 9e18629..4e94c09 100644 --- a/org-link-edit.el +++ b/org-link-edit.el @@ -84,14 +84,14 @@ The list includes ((looking-at org-bracket-link-regexp) (list (match-beginning 0) (match-end 0) - (match-string-no-properties 1) + (org-link-unescape (match-string-no-properties 1)) (or (and (match-end 3) (match-string-no-properties 3)) ""))) ((looking-at org-plain-link-re) (list (match-beginning 0) (match-end 0) - (match-string-no-properties 0) + (org-link-unescape (match-string-no-properties 0)) nil)) (t (error "What am I looking at?")))))) diff --git a/test-org-link-edit.el b/test-org-link-edit.el index 19d8c97..fe8b4a5 100644 --- a/test-org-link-edit.el +++ b/test-org-link-edit.el @@ -447,6 +447,14 @@ website is" (org-link-edit-backward-slurp 1) (org-link-edit-backward-barf 1) (buffer-string)))) + ;; Handle escaped link components. + (should + (string= "Here is \[\[file:t.org::some%20text\]\[Org\]\] file" + (org-test-with-temp-text + "Here is \[\[file:t.org::some%20text\]\[Org\]\] file" + (org-link-edit-forward-slurp 1) + (org-link-edit-forward-barf 1) + (buffer-string)))) ;; Failed round trip because of newline. (should (string= "Here is \[\[http://orgmode.org/\]\[Org's\]\] website" -- cgit v1.2.3