]> code.delx.au - gnu-emacs-elpa/commitdiff
single quotes
authorChris Wanstrath <chris@ozmm.org>
Sun, 7 Mar 2010 04:02:32 +0000 (20:02 -0800)
committerChris Wanstrath <chris@ozmm.org>
Sun, 7 Mar 2010 04:02:32 +0000 (20:02 -0800)
coffee-mode.el

index 51bff0425adf746de595e1a1eb4a82b86c191fed..dbf0780c3f3f341a7a6880b2ee24d1915eb1f1e5 100644 (file)
         ;; would be highlighted.
         ))
 
-
-
+;; the command to comment/uncomment text
+(defun coffee-comment-dwim (arg)
+  "Comment or uncomment current line or region in a smart way.
+For detail, see `comment-dwim'."
+  (interactive "*P")
+  (require 'newcomment)
+  (let ((deactivate-mark nil) (comment-start "#") (comment-end ""))
+    (comment-dwim arg)))
 
 ;; define the mode
 (define-derived-mode coffee-mode fundamental-mode
   (modify-syntax-entry ?# "< b" coffee-mode-syntax-table)
   (modify-syntax-entry ?\n "> b" coffee-mode-syntax-table)
 
+  ;; single quote strings
+  (modify-syntax-entry ?' "\"" coffee-mode-syntax-table)
+  (modify-syntax-entry ?' "\"" coffee-mode-syntax-table)
+
   ;; clear memory
   (setq coffee-keywords-regexp nil)
   (setq coffee-types-regexp nil)