From cf77a8e878f5177121b500e0da1422748e16db04 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Thu, 2 Oct 2014 19:23:03 +0200 Subject: [PATCH] Fix `org-edit-special' on file names with spaces * lisp/org.el (org-edit-special): Fix function when INCLUDE or SETUPFILE keyword points to a file name with spaces. --- lisp/org.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 9228ba00b..efe7cc53d 100755 --- a/lisp/org.el +++ b/lisp/org.el @@ -20528,9 +20528,14 @@ Otherwise, return a user error." (org-open-link-from-string (format "[[%s]]" (expand-file-name - (org-remove-double-quotes - (car (org-split-string - (org-element-property :value element))))))) + (let ((value (org-element-property :value element))) + (cond ((not (org-string-nw-p value)) + (user-error "No file to edit")) + ((string-match "\\`\"\\(.*?\\)\"" value) + (match-string 1 value)) + ((string-match "\\`[^ \t\"]\\S-*" value) + (match-string 0 value)) + (t (user-error "No valid file specified"))))))) (user-error "No special environment to edit here"))) (table (if (eq (org-element-property :type element) 'table.el)