diff options
author | Aaron Ecay <aaronecay@gmail.com> | 2015-10-29 13:31:28 +0000 |
---|---|---|
committer | Aaron Ecay <aaronecay@gmail.com> | 2015-10-29 19:10:08 +0000 |
commit | 54d3032cdcc2c2c30efac41e84ae4ab0543f7ad2 (patch) | |
tree | 09da5601b14b5d28e3d1476bf784a4bf28b2847d | |
parent | 1c740023f7856ad01bcbdfd54f04f0ed448a9aee (diff) | |
download | org-mode-54d3032cdcc2c2c30efac41e84ae4ab0543f7ad2.tar.gz |
babel: fix header arg duplication
* lisp/ob-core.el (org-babel-process-params): Make idempotent.
* testing/lisp/test-ob.el (ob/process-params-no-duplicates): New test.
-rw-r--r-- | lisp/ob-core.el | 5 | ||||
-rw-r--r-- | testing/lisp/test-ob.el | 12 |
2 files changed, 16 insertions, 1 deletions
diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 902315a..9b2a9e2 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -1597,7 +1597,10 @@ shown below. (cons :result-type (cond ((member "output" result-params) 'output) ((member "value" result-params) 'value) (t 'value)))) - (org-babel-get-header params :var 'other)))) + (org-remove-if + (lambda (x) (memq (car x) '(:colname-names :rowname-names :result-params + :result-type :var))) + params)))) ;; row and column names (defun org-babel-del-hlines (table) diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el index 508a3ed..c2feb39 100644 --- a/testing/lisp/test-ob.el +++ b/testing/lisp/test-ob.el @@ -1477,6 +1477,18 @@ echo \"$data\" (should (equal "foo\\\"bar" (org-babel-script-escape "\"foo\\\\\\\"bar\"")))) +(ert-deftest ob/process-params-no-duplicates () + (should (equal (org-babel-process-params '((:colname-names . 1) + (:rowname-names . 1) + (:result-params . 1) + (:result-type . 1) + (:var . "\"foo\""))) + '((:var) + (:colname-names . 1) + (:rowname-names . 1) + (:result-params . 1) + (:result-type . value))))) + (provide 'test-ob) ;;; test-ob ends here |