diff --git a/haskell-font-lock.el b/haskell-font-lock.el index 2d0678ff0..085f5f405 100644 --- a/haskell-font-lock.el +++ b/haskell-font-lock.el @@ -27,7 +27,7 @@ ;;; Code: (require 'cl-lib) -(require 'haskell-mode) +(require 'haskell-compat) (require 'font-lock) (defcustom haskell-font-lock-symbols nil diff --git a/haskell-mode.el b/haskell-mode.el index 114b7b0f5..a69e805f9 100644 --- a/haskell-mode.el +++ b/haskell-mode.el @@ -140,6 +140,7 @@ (require 'haskell-sort-imports) (require 'haskell-string) (require 'haskell-indentation) +(require 'haskell-font-lock) ;; All functions/variables start with `(literate-)haskell-'. diff --git a/tests/haskell-font-lock-tests.el b/tests/haskell-font-lock-tests.el index f6780c6d7..e25c0f241 100644 --- a/tests/haskell-font-lock-tests.el +++ b/tests/haskell-font-lock-tests.el @@ -7,6 +7,9 @@ (insert line) (insert "\n"))) +;; Emacs 24.3 has sql-mode that runs without a product and therefore +;; without font lock initially and needs to be extra enabled +(add-hook 'sql-mode-hook (lambda () (sql-set-product 'ansi))) (defun check-syntax-and-face-match-range (beg end syntax face) "Check if all charaters between positions BEG and END have @@ -424,6 +427,26 @@ if all of its characters have syntax and face. See ("Cons_p" t haskell-constructor-face) ("Cons_x" t haskell-quasi-quote-face)))) +(ert-deftest haskell-syntactic-test-quasiquoter-sql-1 () + "Embedded SQL statements" + (check-properties + '("sql = [sql| SELECT title FROM books; |]") + '(("SELECT" t font-lock-keyword-face) + ("title" t nil) + ("FROM" t font-lock-keyword-face) + ("books" t nil)))) + +(ert-deftest haskell-syntactic-test-quasiquoter-sql-2 () + "Embedded SQL statements" + :expected-result :failed + ;; for now we have this problem that connstructor faces are used, + ;; org-mode knows how to get around this problem + (check-properties + '("sql = [sql| SELECT Title FROM Books; |]") + '(("Title" t nil) + ("Books" t nil)))) + + (ert-deftest haskell-syntactic-test-special-not-redefined () "QuasiQuote should not conflict with TemplateHaskell" (check-properties