mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
haml- and sass-modes should make sure there aren't predefined bindings for the .haml and .sass filetypes.
git-svn-id: svn://hamptoncatlin.com/haml/trunk@430 7063305b-7217-0410-af8c-cdc13e5119b9
This commit is contained in:
parent
827aaa31d7
commit
6d15492e6c
2 changed files with 21 additions and 2 deletions
|
@ -50,6 +50,12 @@
|
|||
(if (= n 0) ""
|
||||
(concat str (string-* str (- n 1)))))
|
||||
|
||||
(defun find-if (f lst)
|
||||
"Returns the first element of a list for which a function returns a non-nil value, or nil if no such element is found."
|
||||
(cond ((null lst) nil)
|
||||
((f (car lst)) (car lst))
|
||||
(find-if f (cdr lst))))
|
||||
|
||||
(defun hre (str)
|
||||
"Prepends a Haml-tab-matching regexp to str."
|
||||
(concat "^\\(" (string-* " " haml-indent-offset) "\\)*" str))
|
||||
|
@ -187,6 +193,9 @@ immediately previous multiple of `haml-indent-offset' spaces."
|
|||
|
||||
(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
|
||||
|
|
|
@ -50,6 +50,12 @@
|
|||
(if (= n 0) ""
|
||||
(concat str (string-* str (- n 1)))))
|
||||
|
||||
(defun find-if (f lst)
|
||||
"Returns the first element of a list for which a function returns a non-nil value, or nil if no such element is found."
|
||||
(cond ((null lst) nil)
|
||||
((f (car lst)) (car lst))
|
||||
(find-if f (cdr lst))))
|
||||
|
||||
(defun sre (str)
|
||||
"Prepends a Sass-tab-matching regexp to str."
|
||||
(concat "^\\(" (string-* " " sass-indent-offset) "\\)*" str))
|
||||
|
@ -144,6 +150,10 @@ immediately previous multiple of `sass-indent-offset' spaces."
|
|||
|
||||
(provide 'sass-mode)
|
||||
|
||||
(add-to-list 'auto-mode-alist '("\\.sass\\'" . sass-mode))
|
||||
|
||||
(unless (find-if
|
||||
#'(lambda(it) (string= it "\\.sass\\'"))
|
||||
(mapcar 'car auto-mode-alist))
|
||||
(add-to-list 'auto-mode-alist '("\\.sass\\'" . sass-mode)))
|
||||
|
||||
;;; sass-mode.el ends here
|
||||
|
|
Loading…
Add table
Reference in a new issue