浏览代码

Revert "Altering org-babel-execute:emacs-lisp in accordance with preceding changes."

This reverts commit d8001facab6ffa844ed5f042facd26268c9aec8c.

Going back to original plan of simply passing (cmd body params) to the org-babel-execute:LANG functions.

The benefit of this is that languages will have access to the full params list. A downside is that code parsing the
params list and referencing variables is currently duplicated across the languages, so perhaps we can aim to reduce
that code duplication at some point.
Dan Davison 16 年之前
父节点
当前提交
9772adef3e
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      lisp/langs/org-babel-lisp.el

+ 3 - 2
lisp/langs/org-babel-lisp.el

@@ -35,12 +35,13 @@
 
 (add-to-list 'org-babel-tangle-langs '("emacs-lisp" "el"))
 
-(defun org-babel-execute:emacs-lisp (session body vars result-type)
+(defun org-babel-execute:emacs-lisp (body params)
   "Execute a block of emacs-lisp code with org-babel.  This
 function is called by `org-babel-execute-src-block'."
   (message "executing emacs-lisp code block...")
   (save-window-excursion
-    (let ((print-level nil) (print-length nil) results)
+    (let ((vars (org-babel-ref-variables params))
+          (print-level nil) (print-length nil) results)
       (setq results
             (eval `(let ,(mapcar (lambda (var) `(,(car var) ',(cdr var))) vars)
                      ,(read (concat "(progn " body ")")))))