mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-24 03:50:24 +10:00
Updating Doom Emacs.
This commit is contained in:
@@ -10,7 +10,8 @@
|
||||
"Run an inferior instance of `julia' inside Emacs."
|
||||
(interactive)
|
||||
(if (require 'julia-repl nil t)
|
||||
(julia-repl)
|
||||
(prog1 (julia-repl)
|
||||
(julia-repl-use-emacsclient))
|
||||
(let ((buffer (get-buffer-create "*Julia*")))
|
||||
(unless (comint-check-proc "*Julia*")
|
||||
(apply #'make-comint-in-buffer "Julia" "*Julia*" julia-program julia-arguments))
|
||||
|
||||
@@ -5,19 +5,19 @@
|
||||
:config
|
||||
(set-repl-handler! 'julia-mode #'+julia/open-repl)
|
||||
|
||||
;; Borrow matlab.el's fontification of math operators
|
||||
;; From <https://ogbe.net/emacsconfig.html>
|
||||
;; 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
|
||||
(concat "\\(" ; stolen `matlab.el' operators first
|
||||
"[<>!]=?" OR
|
||||
"\\.[/*^']" OR
|
||||
"==" OR
|
||||
"=>" OR
|
||||
"\\<xor\\>" OR
|
||||
"[-+*\\/^&|$]=?" OR ;; this has to come before next (updating operators)
|
||||
"[-+*\\/^&|$]=?" OR ; this has to come before next (updating operators)
|
||||
"[-!^&|*+\\/~:]" OR
|
||||
;; more extra julia operators follow
|
||||
"[%$]" OR
|
||||
@@ -30,5 +30,35 @@
|
||||
1 font-lock-type-face)))))
|
||||
|
||||
|
||||
(after! julia-repl
|
||||
(add-hook 'julia-repl-hook #'julia-repl-use-emacsclient))
|
||||
(use-package! julia-repl
|
||||
:preface (defvar +julia-repl-start-hook nil)
|
||||
:hook (julia-mode . julia-repl-mode)
|
||||
:hook (+julia-repl-start . +julia-override-repl-escape-char-h)
|
||||
:hook (+julia-repl-start . julia-repl-use-emacsclient)
|
||||
:config
|
||||
(set-popup-rule! "^\\*julia.*\\*$" :ttl nil)
|
||||
|
||||
(when (featurep! :ui workspaces)
|
||||
(defadvice! +julia--namespace-repl-buffer-to-workspace-a (&optional executable-key suffix)
|
||||
"Name for a Julia REPL inferior buffer. Uses workspace name for doom emacs"
|
||||
:override #'julia-repl--inferior-buffer-name
|
||||
(concat julia-repl-inferior-buffer-name-base ":" (+workspace-current-name))))
|
||||
|
||||
(defadvice! +julia--run-start-hook-a (inferior-buffer)
|
||||
"Run `+julia-repl-start-hook' before displaying the REPL."
|
||||
:after #'julia-repl--setup-term
|
||||
(with-current-buffer inferior-buffer
|
||||
(run-hooks '+julia-repl-start-hook)))
|
||||
|
||||
(defun +julia-override-repl-escape-char-h ()
|
||||
"Use C-c instead of C-x for escaping."
|
||||
(term-set-escape-char ?\C-c)))
|
||||
|
||||
|
||||
(use-package! lsp-julia
|
||||
:when (featurep! +lsp)
|
||||
:after lsp-clients
|
||||
:preface
|
||||
(setq lsp-julia-default-environment "~/.julia/environments/v1.0")
|
||||
(when (featurep! +lsp)
|
||||
(add-hook 'julia-mode-local-vars-hook #'lsp!)))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/julia/packages.el
|
||||
|
||||
(package! julia-mode)
|
||||
(package! julia-repl)
|
||||
(package! julia-mode :pin "1c122f1dff")
|
||||
(package! julia-repl :pin "5fa04de4e7")
|
||||
|
||||
Reference in New Issue
Block a user