Moving to Doom Emacs!

This commit is contained in:
Derek Taylor
2019-12-16 20:21:19 -06:00
parent d9f2f456f1
commit d4b4c33550
683 changed files with 51877 additions and 100 deletions

View 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)))

View 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))

View File

@@ -0,0 +1,5 @@
;; -*- no-byte-compile: t; -*-
;;; lang/julia/packages.el
(package! julia-mode)
(package! julia-repl)