Permalink
Browse files

correctly handling docstrings

  • Loading branch information...
1 parent 9a6af8e commit 4aea575d885265ae42f0fa4b553099e410a5a214 @dcluna committed Feb 11, 2013
Showing with 18 additions and 5 deletions.
  1. +18 −5 sandbox.el
View
@@ -167,11 +167,24 @@ redefunned, return true. "
(sandbox-readonly-check sandbox-fcn)
(let ((is-interactive-form (equal '(interactive) (first body))))
(if docp
- ;; puts the docstring in front
- `(defun sandbox-fcn args ,(first body) (sandbox--check-args ,@args) (sit-for 0) ,(cdr body))
- `(defun sandbox-fcn args (sandbox--check-args ,@args) (sit-for 0) body)))))
-
-(defun make-sandboxed-form)
+ (cons 'defun
+ (cons sandbox-fcn
+ (cons args
+ (cons
+ (first body)
+ (cons
+ `(sandbox--check-args ,@args)
+ (cons
+ '(sit-for 0)
+ (cdr body)))))))
+ (cons 'defun
+ (cons sandbox-fcn
+ (cons args
+ (cons
+ `(sandbox--check-args ,@args)
+ (cons
+ '(sit-for 0)
+ body)))))))))
(defun sandbox-eval (form)
(flet (((intern (concat sandbox-prefix "while")) (cond &rest body) (sandbox-while cond body))

0 comments on commit 4aea575

Please sign in to comment.