From 7e4c7edb8a077149c8da7ede0a4e42e7861a32d9 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Wed, 8 May 2013 18:13:06 +0200 Subject: [PATCH] ox: Small refactoring * lisp/ox.el (org-export-expand-include-keyword): Avoid using `read' to determine file name. --- lisp/ox.el | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/lisp/ox.el b/lisp/ox.el index f28d96985..7a2186f94 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -3267,15 +3267,13 @@ paths." ;; Extract arguments from keyword's value. (let* ((value (org-element-property :value element)) (ind (org-get-indentation)) - (file (let ((f (if (eq (aref value 0) ?\") (read value) - (and (string-match "^\\S-+" value) - (match-string 0 value))))) - (setq value - (progn - (string-match (format "^\"?%s\"?[ \t]*" f) - value) - (replace-match "" nil nil value))) - (expand-file-name f dir))) + (file (and (string-match + "^\\(\".+?\"\\|\\S-+\\)\\(?:\\s-+\\|$\\)" value) + (prog1 (expand-file-name + (org-remove-double-quotes + (match-string 1 value)) + dir) + (setq value (replace-match "" nil nil value))))) (lines (and (string-match ":lines +\"\\(\\(?:[0-9]+\\)?-\\(?:[0-9]+\\)?\\)\"" -- 2.11.4.GIT