diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2019-02-06 19:34:10 +0100 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2019-02-06 19:34:10 +0100 |
commit | 230cc1ee076220673a1ca4800e3e43ee026ec443 (patch) | |
tree | 630111d24a38072cf511e77025004a43f5277c91 | |
parent | ef1edfc25c98233ba179fe743ec6887510f531b3 (diff) | |
parent | 03d7441813592eeda71eab5af25f2a9ce84c1e5c (diff) | |
download | org-mode-230cc1ee076220673a1ca4800e3e43ee026ec443.tar.gz |
Merge branch 'maint'
-rw-r--r-- | lisp/org.el | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/lisp/org.el b/lisp/org.el index 086fcae..82fee46 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -19554,17 +19554,15 @@ Otherwise, return a user error." (unless (member (org-element-property :key element) '("INCLUDE" "SETUPFILE")) (user-error "No special environment to edit here")) - (org-open-link-from-string - (format "[[%s]]" - (expand-file-name - (let ((value (org-strip-quotes - (org-element-property :value element)))) - (cond - ((not (org-string-nw-p value)) - (user-error "No file to edit")) - ((org-file-url-p value) - (user-error "Files located with a URL cannot be edited")) - (t value))))))) + (let ((value (org-element-property :value element))) + (unless (org-string-nw-p value) (user-error "No file to edit")) + (let ((file (and (string-match "\\`\"\\(.*?\\)\"\\|\\S-+" value) + (or (match-string 1 value) + (match-string 0 value))))) + (when (org-file-url-p file) + (user-error "Files located with a URL cannot be edited")) + (org-open-link-from-string + (format "[[%s]]" (expand-file-name file)))))) (`table (if (eq (org-element-property :type element) 'table.el) (org-edit-table.el) |