diff --git a/elixir-mode.el b/elixir-mode.el index 80401ce8..33ada44c 100644 --- a/elixir-mode.el +++ b/elixir-mode.el @@ -142,9 +142,9 @@ (and "\"" (one-or-more (not (any "\""))) "\"") (and "'" (one-or-more (not (any "'"))) "'")))) (builtin . ,(rx symbol-start - (or "case" "cond" "for" "if" "unless" "try" "receive" - "raise" "quote" "unquote" "unquote_splicing" "throw" - "super" "send") + (or "case" "cond" "for" "if" "quote" "raise" "receive" "send" + "super" "throw" "try" "unless" "unquote" "unquote_splicing" + "with") symbol-end)) (builtin-declaration . ,(rx symbol-start (or "def" "defp" "defmodule" "defprotocol" diff --git a/test/elixir-mode-font-test.el b/test/elixir-mode-font-test.el index cb4a011b..0f7dd8ff 100644 --- a/test/elixir-mode-font-test.el +++ b/test/elixir-mode-font-test.el @@ -321,6 +321,21 @@ when" end" (should (eq (elixir-test-face-at 40) 'font-lock-keyword-face)))) +(ert-deftest elixir-mode-syntax-table/highlight-with () + "Highlight with as a keyword" + :tags '(fontification syntax-table) + (elixir-test-with-temp-buffer + "defmodule Foo do + def bar(opts) do + with( + {:ok, width} <- Map.fetch(opts, :width), + {:ok, height} <- Map.fetch(opts, :height), + do: {:ok, width * height} + ) + end +end" + (should (eq (elixir-test-face-at 41) 'font-lock-keyword-face)))) + (ert-deftest elixir-mode-syntax-table/string-interpolation-in-words-list () "https://github.com/elixir-lang/emacs-elixir/issues/263" :tags '(fontification syntax-table)