Permalink
Browse files

tweaks

  • Loading branch information...
1 parent 28485fa commit 5256afdeb531e758931a7e56e46b2c46dcb49ee2 @defunkt committed Mar 7, 2010
Showing with 10 additions and 8 deletions.
  1. +4 −3 README.md
  2. +6 −5 coffee-mode.el
View
7 README.md
@@ -44,7 +44,7 @@ Well, idiomatic CoffeeScript uses two spaces. We can set our
Another example of this hook is given further down.
-### Theory
+### TAB Theory
When you press `TAB`, indent the line unless doing so would make the
current line more than two indentation levels deepers than the
@@ -73,8 +73,9 @@ Pressing `TAB` again will produce this code:
^
And so on. I think this is a pretty good way of getting decent
-indentation without having to do anything complicated in our major
-mode.
+indentation with a whitespace-sensitive
+
+### Newline and Indent
As for indentation after newlines, given this code:
View
11 coffee-mode.el
@@ -145,6 +145,7 @@ print the compiled JavaScript.")
'("CoffeeScript"
["Compile Buffer" coffee-compile-buffer]
["Compile Region" coffee-compile-region]
+ ["REPL" coffee-repl]
"---"
["CoffeeScript reference" coffee-open-reference]
["coffee-mode on GitHub" coffee-open-github]
@@ -156,16 +157,16 @@ print the compiled JavaScript.")
;;
;; Instance variables (implicit this)
-(setq coffee-this-regexp "@\\w*\\|this")
+(defvar coffee-this-regexp "@\\w*\\|this")
;; Assignment
-(setq coffee-assign-regexp "\\(\\w\\|\\.\\|_\\| \\|$\\)+?:")
+(defvar coffee-assign-regexp "\\(\\w\\|\\.\\|_\\| \\|$\\)+?:")
;; Booleans
-(setq coffee-boolean-regexp "\\b\\(true\\|false\\|yes\\|no\\|on\\|off\\)\\b")
+(defvar coffee-boolean-regexp "\\b\\(true\\|false\\|yes\\|no\\|on\\|off\\)\\b")
;; Unused
-(setq coffee-regexp-regexp "\\/.+?\\/")
+(defvar coffee-regexp-regexp "\\/.+?\\/")
;; JavaScript Keywords
(defvar coffee-js-keywords
@@ -195,7 +196,7 @@ print the compiled JavaScript.")
;; Create the list for font-lock.
;; Each class of keyword is given a particular face
-(setq coffee-font-lock-keywords
+(defvar coffee-font-lock-keywords
`(
(,coffee-this-regexp . font-lock-variable-name-face)
(,coffee-assign-regexp . font-lock-type-face)

0 comments on commit 5256afd

Please sign in to comment.