mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-24 03:50:24 +10:00
Moving to Doom Emacs!
This commit is contained in:
20
.emacs.d/modules/lang/julia/autoload.el
Normal file
20
.emacs.d/modules/lang/julia/autoload.el
Normal file
@@ -0,0 +1,20 @@
|
||||
;;; lang/julia/autoload.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; `ob-julia' needs this variable to be defined, but it's defined in
|
||||
;; `ess-custom', which won't be available if you're using :lang julia and not
|
||||
;; :lang ess.
|
||||
;;;###autoload (defvar inferior-julia-program-name (or (executable-find "julia-basic") "julia"))
|
||||
|
||||
;;;###autoload
|
||||
(defun +julia/open-repl ()
|
||||
"Run an inferior instance of `julia' inside Emacs."
|
||||
(interactive)
|
||||
(if (require 'julia-repl nil t)
|
||||
(julia-repl)
|
||||
(let ((buffer (get-buffer-create "*Julia*")))
|
||||
(unless (comint-check-proc "*Julia*")
|
||||
(apply #'make-comint-in-buffer "Julia" "*Julia*" julia-program julia-arguments))
|
||||
(pop-to-buffer buffer)
|
||||
(with-current-buffer buffer
|
||||
(inferior-julia-mode))
|
||||
buffer)))
|
||||
34
.emacs.d/modules/lang/julia/config.el
Normal file
34
.emacs.d/modules/lang/julia/config.el
Normal file
@@ -0,0 +1,34 @@
|
||||
;;; lang/julia/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(use-package! julia-mode
|
||||
:interpreter "julia"
|
||||
:config
|
||||
(set-repl-handler! 'julia-mode #'+julia/open-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)))))
|
||||
|
||||
|
||||
(after! julia-repl
|
||||
(add-hook 'julia-repl-hook #'julia-repl-use-emacsclient))
|
||||
5
.emacs.d/modules/lang/julia/packages.el
Normal file
5
.emacs.d/modules/lang/julia/packages.el
Normal file
@@ -0,0 +1,5 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/julia/packages.el
|
||||
|
||||
(package! julia-mode)
|
||||
(package! julia-repl)
|
||||
Reference in New Issue
Block a user