From 09efa24ab857d9d9ea594bdcf4a047b523b67003 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 26 Apr 2017 23:29:31 -0400 Subject: [PATCH] lang/julia: stea--borrow matlab.el's fontification of math operators --- modules/lang/julia/config.el | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/modules/lang/julia/config.el b/modules/lang/julia/config.el index fb28bdf1a..badeac8dd 100644 --- a/modules/lang/julia/config.el +++ b/modules/lang/julia/config.el @@ -4,5 +4,28 @@ :mode "\\.jl$" :interpreter "julia" :config - (set! :repl 'julia-mode #'+julia/repl)) + (set! :repl 'julia-mode #'+julia/repl) + + ;; Borrow matlab.el's fontification of math operators + ;; From + (font-lock-add-keywords + 'julia-mode + `((,(let ((OR "\\|")) + (concat "\\(" ;; stolen `matlab.el' operators first + "[<>!]=?" OR + "\\.[/*^']" OR + "==" OR + "=>" OR + "\\" OR + "[-+*\\/^&|$]=?" OR ;; this has to come before next (updating operators) + "[-!^&|*+\\/~:]" OR + ;; more extra julia operators follow + "[%$]" OR + ;; bitwise operators + ">>>" OR ">>" OR "<<" OR + ">>>=" OR ">>" OR "<<" OR + ;; comparison + "[<>!]=?" OR + "\\)")) + 1 font-lock-type-face))))