From 5b76509830ec5627c4ccce7415b2ed91a6df7d23 Mon Sep 17 00:00:00 2001 From: Aaron Ecay Date: Sat, 7 Nov 2015 20:11:14 +0000 Subject: [PATCH] =?UTF-8?q?org-lint:=20don=E2=80=99t=20call=20org-babel-pr?= =?UTF-8?q?ocess-params?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lisp/org-lint.el (org-lint-wrong-header-value): Don’t call `org-babel-process-params'. This function adds generated values to the header args: it’s never a user error if these are incorrect. It also calls babel code to resolve :var references, which makes linting an undesirably long and potentially side-effectful operation. --- lisp/org-lint.el | 59 ++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/lisp/org-lint.el b/lisp/org-lint.el index efbffde17..37d05edc9 100644 --- a/lisp/org-lint.el +++ b/lisp/org-lint.el @@ -883,36 +883,35 @@ Use :header-args: instead" (and (boundp v) (symbol-value v)))) org-babel-common-header-args-w-values)) (datum-header-values - (org-babel-process-params - (apply - #'org-babel-merge-params - org-babel-default-header-args - (and language - (let ((v (intern (concat "org-babel-default-header-args:" - language)))) - (and (boundp v) (symbol-value v)))) - (append - (list (and (memq type '(babel-call inline-babel-call)) - org-babel-default-lob-header-args)) - (progn (goto-char (org-element-property :begin datum)) - (org-babel-params-from-properties language)) - (list - (org-babel-parse-header-arguments - (org-trim - (pcase type - (`src-block - (mapconcat - #'identity - (cons (org-element-property :parameters datum) - (org-element-property :header datum)) - " ")) - (`inline-src-block - (or (org-element-property :parameters datum) "")) - (_ - (concat - (org-element-property :inside-header datum) - " " - (org-element-property :end-header datum)))))))))))) + (apply + #'org-babel-merge-params + org-babel-default-header-args + (and language + (let ((v (intern (concat "org-babel-default-header-args:" + language)))) + (and (boundp v) (symbol-value v)))) + (append + (list (and (memq type '(babel-call inline-babel-call)) + org-babel-default-lob-header-args)) + (progn (goto-char (org-element-property :begin datum)) + (org-babel-params-from-properties language)) + (list + (org-babel-parse-header-arguments + (org-trim + (pcase type + (`src-block + (mapconcat + #'identity + (cons (org-element-property :parameters datum) + (org-element-property :header datum)) + " ")) + (`inline-src-block + (or (org-element-property :parameters datum) "")) + (_ + (concat + (org-element-property :inside-header datum) + " " + (org-element-property :end-header datum))))))))))) (dolist (header datum-header-values) (let ((allowed-values (cdr (assoc-string (substring (symbol-name (car header)) 1)