Browse Source

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.
Aaron Ecay 3 years ago
parent
commit
5b76509830
1 changed files with 29 additions and 30 deletions
  1. 29 30
      lisp/org-lint.el

+ 29 - 30
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)