From e900ebed08c444ad2813060195e9ece7f6bd910b Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Wed, 17 Jun 2015 11:55:57 +0200 Subject: [PATCH] ob-core: Small refactoring * lisp/ob-core.el (org-babel-params-from-properties): Refactor code to avoid nesting `mapcar' calls. --- lisp/ob-core.el | 46 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 6821b6dfc..ae79fe66d 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -1409,33 +1409,31 @@ specified in the properties of the current outline entry." (save-match-data (list ;; DEPRECATED header arguments specified as separate property at - ;; point of definition - (let (val sym) - (org-babel-parse-multiple-vars - (delq nil - (mapcar - (lambda (header-arg) - (and (setq val (org-entry-get (point) header-arg t)) - (cons (intern (concat ":" header-arg)) - (org-babel-read val)))) - (mapcar - #'symbol-name - (mapcar - #'car - (org-babel-combine-header-arg-lists - org-babel-common-header-args-w-values - (progn - (setq sym (intern (concat "org-babel-header-args:" lang))) - (and (boundp sym) (eval sym)))))))))) + ;; point of definition. + (org-babel-parse-multiple-vars + (delq nil + (mapcar + (lambda (header) + (let* ((arg (symbol-name (car header))) + (val (org-entry-get (point) arg t))) + (and val + (cons (intern (concat ":" arg)) + (org-babel-read val))))) + (org-babel-combine-header-arg-lists + org-babel-common-header-args-w-values + (let ((sym (intern (concat "org-babel-header-args:" lang)))) + (and (boundp sym) (symbol-value sym))))))) ;; header arguments specified with the header-args property at - ;; point of call + ;; point of call. (org-babel-parse-header-arguments (org-entry-get org-babel-current-src-block-location - "header-args" 'inherit)) - (when lang ;; language-specific header arguments at point of call - (org-babel-parse-header-arguments - (org-entry-get org-babel-current-src-block-location - (concat "header-args:" lang) 'inherit)))))) + "header-args" + 'inherit)) + (and lang ; language-specific header arguments at point of call + (org-babel-parse-header-arguments + (org-entry-get org-babel-current-src-block-location + (concat "header-args:" lang) + 'inherit)))))) (defvar org-src-preserve-indentation) ;; declare defcustom from org-src (defun org-babel-parse-src-block-match () -- 2.11.4.GIT