lang/julia: stea--borrow matlab.el's fontification of math operators
This commit is contained in:
parent
b425f45875
commit
09efa24ab8
1 changed files with 24 additions and 1 deletions
|
@ -4,5 +4,28 @@
|
||||||
:mode "\\.jl$"
|
:mode "\\.jl$"
|
||||||
:interpreter "julia"
|
:interpreter "julia"
|
||||||
:config
|
:config
|
||||||
(set! :repl 'julia-mode #'+julia/repl))
|
(set! :repl 'julia-mode #'+julia/repl)
|
||||||
|
|
||||||
|
;; Borrow matlab.el's fontification of math operators
|
||||||
|
;; From <https://ogbe.net/emacsconfig.html>
|
||||||
|
(font-lock-add-keywords
|
||||||
|
'julia-mode
|
||||||
|
`((,(let ((OR "\\|"))
|
||||||
|
(concat "\\(" ;; stolen `matlab.el' operators first
|
||||||
|
"[<>!]=?" OR
|
||||||
|
"\\.[/*^']" OR
|
||||||
|
"==" OR
|
||||||
|
"=>" OR
|
||||||
|
"\\<xor\\>" 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))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue