From bd27a005bb9ddc547de5e08722f2f15df7d48e49 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Tue, 7 May 2013 17:47:59 +0200 Subject: [PATCH] ox: Tolerate included file names without double quotes * lisp/ox.el (org-export-expand-include-keyword): Tolerate included file names without double quotes. --- lisp/ox.el | 138 ++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 73 insertions(+), 65 deletions(-) diff --git a/lisp/ox.el b/lisp/ox.el index 42c9b702b..bf14bfacb 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -3256,73 +3256,81 @@ working directory. It is used to properly resolve relative paths." (let ((case-fold-search t)) (goto-char (point-min)) - (while (re-search-forward "^[ \t]*#\\+INCLUDE: +\\(.*\\)[ \t]*$" nil t) - (when (eq (org-element-type (save-match-data (org-element-at-point))) - 'keyword) - (beginning-of-line) - ;; Extract arguments from keyword's value. - (let* ((value (match-string 1)) - (ind (org-get-indentation)) - (file (and (string-match "^\"\\(\\S-+\\)\"" value) - (prog1 (expand-file-name (match-string 1 value) dir) - (setq value (replace-match "" nil nil value))))) - (lines - (and (string-match - ":lines +\"\\(\\(?:[0-9]+\\)?-\\(?:[0-9]+\\)?\\)\"" value) - (prog1 (match-string 1 value) - (setq value (replace-match "" nil nil value))))) - (env (cond ((string-match "\\" value) 'example) - ((string-match "\\" value) 'example) + ((string-match "\\