From 978fd46069573f46f6d3c1fe54539b3bef6b09bb Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Mon, 23 Jan 2012 11:07:27 -0700 Subject: [PATCH] don't report valid header arguments as suspicious * lisp/ob.el (org-babel-check-src-block): Don't report valid header arguments as suspicious. --- lisp/ob.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/ob.el b/lisp/ob.el index c603203b9..f75412e1b 100644 --- a/lisp/ob.el +++ b/lisp/ob.el @@ -607,15 +607,17 @@ arguments and pop open the results in a preview buffer." ;; TODO: report malformed code block ;; TODO: report incompatible combinations of header arguments ;; TODO: report uninitialized variables - (let ((too-close 2)) ;; <- control closeness to report potential match + (let ((too-close 2) ;; <- control closeness to report potential match + (names (mapcar #'symbol-name org-babel-header-arg-names))) (dolist (header (mapcar (lambda (arg) (substring (symbol-name (car arg)) 1)) (and (org-babel-where-is-src-block-head) (org-babel-parse-header-arguments (org-babel-clean-text-properties (match-string 4)))))) - (dolist (name (mapcar #'symbol-name org-babel-header-arg-names)) + (dolist (name names) (when (and (not (string= header name)) - (<= (org-babel-edit-distance header name) too-close)) + (<= (org-babel-edit-distance header name) too-close) + (not (member header names))) (error "supplied header \"%S\" is suspiciously close to \"%S\"" header name)))) (message "No suspicious header arguments found.")))