org-lint: don’t call org-babel-process-params

* 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.
This commit is contained in:
Aaron Ecay 2015-11-07 20:11:14 +00:00
parent f0380f54c1
commit 5b76509830
1 changed files with 29 additions and 30 deletions

View File

@ -883,36 +883,35 @@ Use :header-args: instead"
(and (boundp v) (symbol-value v)))) (and (boundp v) (symbol-value v))))
org-babel-common-header-args-w-values)) org-babel-common-header-args-w-values))
(datum-header-values (datum-header-values
(org-babel-process-params (apply
(apply #'org-babel-merge-params
#'org-babel-merge-params org-babel-default-header-args
org-babel-default-header-args (and language
(and language (let ((v (intern (concat "org-babel-default-header-args:"
(let ((v (intern (concat "org-babel-default-header-args:" language))))
language)))) (and (boundp v) (symbol-value v))))
(and (boundp v) (symbol-value v)))) (append
(append (list (and (memq type '(babel-call inline-babel-call))
(list (and (memq type '(babel-call inline-babel-call)) org-babel-default-lob-header-args))
org-babel-default-lob-header-args)) (progn (goto-char (org-element-property :begin datum))
(progn (goto-char (org-element-property :begin datum)) (org-babel-params-from-properties language))
(org-babel-params-from-properties language)) (list
(list (org-babel-parse-header-arguments
(org-babel-parse-header-arguments (org-trim
(org-trim (pcase type
(pcase type (`src-block
(`src-block (mapconcat
(mapconcat #'identity
#'identity (cons (org-element-property :parameters datum)
(cons (org-element-property :parameters datum) (org-element-property :header datum))
(org-element-property :header datum)) " "))
" ")) (`inline-src-block
(`inline-src-block (or (org-element-property :parameters datum) ""))
(or (org-element-property :parameters datum) "")) (_
(_ (concat
(concat (org-element-property :inside-header datum)
(org-element-property :inside-header datum) " "
" " (org-element-property :end-header datum)))))))))))
(org-element-property :end-header datum))))))))))))
(dolist (header datum-header-values) (dolist (header datum-header-values)
(let ((allowed-values (let ((allowed-values
(cdr (assoc-string (substring (symbol-name (car header)) 1) (cdr (assoc-string (substring (symbol-name (car header)) 1)