doomemacs/modules/lang/julia/config.el
Henrik Lissner 0edeafadcf
lang/julia: operator highlights for ess-julia-mode
And adjust REPL handler to return the repl buffer.
2019-02-15 19:43:13 -05:00

30 lines
1 KiB
EmacsLisp

;;; lang/julia/config.el -*- lexical-binding: t; -*-
(use-package julia-mode
:interpreter "julia"
:config
(set-repl-handler! 'julia-mode #'+julia/repl)
;; Borrow matlab.el's fontification of math operators
;; From <https://ogbe.net/emacsconfig.html>
(dolist (mode '(julia-mode ess-julia-mode))
(font-lock-add-keywords
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)))))