From 0a655dfaab1651eeeffed53bf4bbec443a5ce91b Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Fri, 14 Nov 2014 15:07:01 +0000 Subject: Font lock @usernames --- sx-question-mode.el | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sx-question-mode.el') diff --git a/sx-question-mode.el b/sx-question-mode.el index e80f3d9..4f5116c 100644 --- a/sx-question-mode.el +++ b/sx-question-mode.el @@ -267,6 +267,11 @@ DATA can represent a question or an answer." (with-temp-buffer (insert text) (markdown-mode) + ;; Highlight usernames. + (font-lock-add-keywords + nil + '(("\\(?: \\|^\\)\\(@\\(?:\\sw\\|\\s_\\)+\\)\\_>" + 1 font-lock-builtin-face))) (goto-char (point-min)) (font-lock-fontify-region (point-min) (point-max)) ;; Do something here -- cgit v1.2.3