diff options
Diffstat (limited to 'sample/ruby-mode.el')
-rw-r--r-- | sample/ruby-mode.el | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sample/ruby-mode.el b/sample/ruby-mode.el index d379a633c3..8bf843c1ea 100644 --- a/sample/ruby-mode.el +++ b/sample/ruby-mode.el @@ -209,7 +209,7 @@ The variable ruby-indent-level controls the amount of indentation. (looking-at ruby-block-mid-re)) (progn (goto-char (match-end 0)) - (looking-at "[^_]"))))))))) + (looking-at "\\>"))))))))) (defun ruby-parse-region (start end) (let ((indent-point end) @@ -253,7 +253,7 @@ The variable ruby-indent-level controls the amount of indentation. ((looking-at "%") (cond ((and (not (eobp)) (ruby-expr-beg) - (looking-at "%[Qqrx]?\\(.\\)")) + (looking-at "%[Qqrxw]?\\(.\\)")) (setq w (buffer-substring (match-beginning 1) (match-end 1))) (cond @@ -598,7 +598,7 @@ An end of a defun is found by moving forward from the beginning of one." ("[^$\\?]\\('[^\\']*\\(\\\\\\(.\\|\n\\)[^\\']*\\)*'\\)" 1 string) ("[^$\\?]\\(`[^\\`]*\\(\\\\\\(.\\|\n\\)[^\\`]*\\)*`\\)" 1 string) ("^\\s *#.*$" nil comment) - ("[^$@?\\]\\(#[^$@{].*$\\)" 1 comment) + ("[^$@?\\]\\(#[^$@{\n].*$\\)" 1 comment) ("[^a-zA-Z_]\\(\\?\\(\\\\[CM]-\\)*.\\)" 1 string) ("^\\s *\\(require\\|load\\).*$" nil include) ("^\\s *\\(include\\|alias\\|undef\\).*$" nil decl) @@ -624,6 +624,7 @@ An end of a defun is found by moving forward from the beginning of one." "break" "case" "class" + "def" "do" "elsif" "else" @@ -652,7 +653,7 @@ An end of a defun is found by moving forward from the beginning of one." "while" ) "\\|") - "\\)[ \n\t()]") + "\\)\\b") 2) ;; variables '("\\(^\\|[^_]\\)\\b\\(nil\\|self\\|true\\|false\\)\\b\\([^_]\\|$\\)" @@ -664,8 +665,8 @@ An end of a defun is found by moving forward from the beginning of one." '("\\(^\\|[^_]\\)\\b\\([A-Z]+[a-zA-Z0-9_]*\\)" 2 font-lock-type-face) ;; functions - '("^\\s *def[ \t]+[^ \t(]*" - 0 font-lock-function-name-face t)) + '("^\\s *def[ \t]+\\([^ \t(]*\\)" + 1 font-lock-function-name-face t)) "*Additional expressions to highlight in ruby mode.") (if (and (>= (string-to-int emacs-version) 19) (not (featurep 'xemacs))) |