From ced2cf6c5ef5d0f814e7c6309b8f9e10e16e9c99 Mon Sep 17 00:00:00 2001 From: Martin Gausby Date: Wed, 21 Oct 2015 15:11:13 +0200 Subject: [PATCH] Added `send` and `send_after` to font lock They are highlighted as keywords. --- elixir-mode.el | 2 +- test/elixir-mode-font-test.el | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/elixir-mode.el b/elixir-mode.el index 77a0f6b8..1d772e6a 100644 --- a/elixir-mode.el +++ b/elixir-mode.el @@ -135,7 +135,7 @@ symbol-start (or "case" "cond" "for" "if" "unless" "try" "receive" "raise" "quote" "unquote" "unquote_splicing" "throw" - "super") + "super" "send" "send_after") symbol-end)) (builtin-declaration . ,(rx (or line-start (not (any "."))) symbol-start diff --git a/test/elixir-mode-font-test.el b/test/elixir-mode-font-test.el index 4002662e..b9917ade 100644 --- a/test/elixir-mode-font-test.el +++ b/test/elixir-mode-font-test.el @@ -301,6 +301,20 @@ when" (should-not (eq (elixir-test-face-at 67) 'font-lock-keyword-face)) (should (eq (elixir-test-face-at 72) 'font-lock-keyword-face)))) +(ert-deftest elixir-mode-syntax-table/highlight-send-and-send-after () + "Highlight both send and send_after as keywords" + :tags '(fontification syntax-table) + (elixir-test-with-temp-buffer + "defmodule Foo do + def bar(pid) do + send pid, :baz + send_after pid, :baz, 5000 + end +end" + (should (eq (elixir-test-face-at 40) 'font-lock-keyword-face)) + (should (eq (elixir-test-face-at 60) 'font-lock-keyword-face)) + (should (eq (elixir-test-face-at 65) '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)