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.
This commit is contained in:
Nicolas Goaziou 2014-10-02 19:23:03 +02:00
parent 986037a538
commit cf77a8e878
1 changed files with 8 additions and 3 deletions

View File

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