From c6562afd3370ab4972771286e71a27557befc9d1 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Sun, 7 Mar 2010 18:49:33 -0800 Subject: [PATCH] Make `coffee-debug' a macro --- coffee-mode.el | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/coffee-mode.el b/coffee-mode.el index b8dc9ca..9dd35ba 100644 --- a/coffee-mode.el +++ b/coffee-mode.el @@ -100,10 +100,15 @@ print the compiled JavaScript.") (defmacro setd (var val) "Like setq but optionally logs the variable's value using `coffee-debug'." (if coffee-debug-mode - `(progn - (coffee-debug "%s: %s" ',var ,val) - (setq ,var ,val)) - `(setq ,var ,val))) + `(progn + (coffee-debug "%s: %s" ',var ,val) + (setq ,var ,val)) + `(setq ,var ,val))) + +(defmacro coffee-debug (string &rest args) + "Print a message when in debug mode." + (when coffee-debug-mode + `(apply 'message (append (list ,string) ,args)))) ;; ;; Commands @@ -250,11 +255,6 @@ For detail, see `comment-dwim'." "The full `coffee-command' complete with args." (mapconcat 'identity (append (list coffee-command) coffee-command-args) " ")) -(defun coffee-debug (string &rest args) - "Print a message when in debug mode." - (when coffee-debug-mode - (apply 'message (append (list string) args)))) - ;; ;; imenu support ;; @@ -304,7 +304,7 @@ For detail, see `comment-dwim'." (let ((index-alist '()) assign pos indent ns-name ns-indent) ;; Go through every assignment that includes -> or => on the same - ;; line. + ;; line or starts with `class'. (while (re-search-forward (concat "^\\(\\s *\\)" "\\("