; Some rather simple helper functions for generating js code. (defun dojo-insert-js (text) (cond ((null text) (newline)) ((listp text) (dolist (s text) (dojo-insert-js s) )) (t (insert text) (indent-for-tab-command) (newline)) ) ) (defun dojo-insert-fct-start (name params) (dojo-insert-js (concat name " : function(" params ") {")) ) (defun dojo-insert-fct-end () (dojo-insert-js "},") (newline) ) (defun dojo-insert-fct (name params line &optional no-final-comma) (dojo-insert-fct-start name params) (dojo-insert-js line) (if no-final-comma (dojo-insert-js "}") (dojo-insert-fct-end) ) ) (provide 'dojo-jsgen-common-js)