Committed. My emacs didn't have a definition for find-if, so I added
one for the modes.

Thanks for the patch!
- Nathan

On Mar 17, 1:32 pm, "Dmitry Galinsky" <[EMAIL PROTECTED]> wrote:
> Has made initial support font-lock, a patch below
>
> ----
> Index: haml-mode.el
> ===================================================================
> --- haml-mode.el        (revision 427)
> +++ haml-mode.el        (working copy)
> @@ -54,6 +54,15 @@
>    "Prepends a Haml-tab-matching regexp to str."
>    (concat "^\\(" (string-* " " haml-indent-offset) "\\)*" str))
>
> +;; Font lock
> +(defconst haml-font-lock-keywords-1
> +  (list
> +   '("%\\w+"        . font-lock-function-name-face)
> +   '("#\\w+"        . font-lock-keyword-face)
> +   '("= .*"         . font-lock-string-face)
> +   '("[ \t]*- .*"   . font-lock-string-face)
> +   '("!!!"          . font-lock-constant-face)))
> +
>  ;; Constants
>
>  (defconst haml-mode-version "0.0.1" "Version of `haml-mode.'")
> @@ -108,7 +117,12 @@
>
>  \\{haml-mode-map}"
>    (set (make-local-variable 'indent-line-function) 'haml-indent-line)
> -  (set (make-local-variable 'font-lock-defaults) '(sample-font-lock-
> keywords)))
> +  (set (make-local-variable 'font-lock-defaults) '(sample-font-lock-
> keywords))
> +  (make-local-variable 'font-lock-defaults)
> +  (setq font-lock-defaults
> +        '((haml-font-lock-keywords-1)
> +          nil
> +          t)))
>
>  ;; Indentation and electric keys
>
> @@ -173,6 +187,9 @@
>
>  (provide 'haml-mode)
>
> -(add-to-list 'auto-mode-alist '("\\.haml\\'" . haml-mode))
> +(unless (find-if
> +         #'(lambda(it) (string= it "\\.haml\\'"))
> +         (mapcar 'car auto-mode-alist))
> +  (add-to-list 'auto-mode-alist '("\\.haml\\'" . haml-mode)))
>
>  ;;; haml-mode.el ends here


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to