Tweak Julia setup for oglot

This commit is contained in:
Gerard Vermeulen 2024-02-27 18:19:24 +01:00
parent 0dc172f112
commit a80fa2ff6e
1 changed files with 90 additions and 6 deletions

View File

@ -2355,7 +2355,7 @@ list detailing and motivating each listing:
(eshell . t)
(fortran . t)
(gnuplot . ,(fboundp 'gnuplot-mode))
(js . t)
(julia . t)
(latex . t)
(lilypond . ,(fboundp 'lilypond-mode))
(lisp . t)
@ -4720,7 +4720,7 @@ listings contribute to a programming language mode independent [[https://github.
configuration:
1. Listing [[lst:minimal-eglot-setup][minimal Eglot setup]] adds key bindings to =eglot-mode-keymap=.
2. Listing [[lst:setup-oglot]] uses [[https://github.com/gav451/oglot#][oglot]] to enable using [[https://github.com/joaotavora/eglot][Eglot]] in =org-src-mode=
Python buffers.
Julia and Python buffers.
3. Listing [[lst:eglot-maybe-ensure]] starts [[https://github.com/joaotavora/eglot][Eglot]] in case of proper programming
modes and proper directory local variables (meaning in presence of a proper
file [[info:emacs#Directory Variables][.dir-locals.el]] in the root directory of any project using proper
@ -4743,7 +4743,10 @@ configuration:
#+begin_src emacs-lisp -n :results silent
(when (and (package-installed-p 'oglot)
(require 'oglot nil 'noerror))
(setopt oglot-maybe-ensure-modes '(python-mode)))
(push (expand-file-name "~/VCS/eglot-jl") load-path)
(require 'eglot-jl)
(eglot-jl-init)
(setopt oglot-maybe-ensure-modes '(julia-mode python-mode)))
#+end_src
#+caption[Start =eglot= in case of a proper =dir-local-variables-alist=]:
@ -5908,9 +5911,7 @@ Listing [[lst:setup-julia]] setups [[https://julialang.org/][Julia]] support but
#+begin_src emacs-lisp -n :results silent
(push (expand-file-name "~/VCS/ESS/lisp") load-path)
(when (require 'ess-julia nil 'noerror)
(setopt inferior-julia-program (executable-find "julia"))
(require 'ob-julia)
(ensure-package-installation 'eglot-jl))
(setopt inferior-julia-program (executable-find "julia")))
#+end_src
#+caption[List installed Julia packages]:
@ -5935,6 +5936,89 @@ Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
#+end_src
#+caption[List ~Makefile~ for ~Homebrew~ patch]:
#+caption: List ~Makefile~ for ~Homebrew~ patch.
#+name: lst:list-makefile-for-homebrew-patch
#+header: :wrap "src diff -n"
#+begin_src shell :exports both :results raw
cat "$HOME/VCS/ESS/0001-Patch-Makefile-for-Home-Brew.patch"
#+end_src
*** ESS Makefile for Homebrew patch
:PROPERTIES:
:CUSTOM_ID: sec:ess-for-homebrew-patch
:END:
#+RESULTS: lst:list-makefile-for-homebrew-patch
#+begin_src diff -n
From 71729a02a190c1f1bfca02dd6db6d5f736437d5a Mon Sep 17 00:00:00 2001
From: Gerard Vermeulen <gerard.vermeulen@posteo.net>
Date: Mon, 26 Feb 2024 19:48:19 +0100
Subject: [PATCH] Patch Makefile for Home Brew
---
Makefile | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/Makefile b/Makefile
index 182094a3..3409cf66 100644
--- a/Makefile
+++ b/Makefile
@@ -4,14 +4,14 @@
include ./Makeconf
ESSVERSION := $(shell cat VERSION)
-PKGVERSION := $(shell sed -n 's/;; Version: *\(.*\) */\1/p' lisp/ess.el)
+PKGVERSION := $(shell gsed -n 's/;; Version: *\(.*\) */\1/p' lisp/ess.el)
ESSDIR := ess-$(ESSVERSION)
ifneq ($(ESSVERSION), $(PKGVERSION))
- $(shell sed -i 's/Version: .*/Version: $(ESSVERSION)/' VERSION)
- ${shell sed -i 's/;; Version: .*/;; Version: $(ESSVERSION)/' lisp/ess.el}
+ $(shell gsed -i 's/Version: .*/Version: $(ESSVERSION)/' VERSION)
+ ${shell gsed -i 's/;; Version: .*/;; Version: $(ESSVERSION)/' lisp/ess.el}
endif
-ESSR-VERSION := $(shell sed -n "s/;; ESSR-Version: *\(.*\) */\1/p" lisp/ess.el)
+ESSR-VERSION := $(shell gsed -n "s/;; ESSR-Version: *\(.*\) */\1/p" lisp/ess.el)
.PHONY: all
all: lisp doc etc autoloads
@@ -19,10 +19,10 @@ all: lisp doc etc autoloads
.PHONY: version
version: VERSION
@echo "********************* VERSIONS **************************"
- @echo $(shell $(EMACS) --version | sed -n 1p)
+ @echo $(shell $(EMACS) --version | gsed -n 1p)
@echo ESS $(ESSVERSION)
@echo ESSR $(ESSR-VERSION)
- @sed -i "s/\"VERSION\"/\"$(ESSVERSION)\"/" lisp/ess-custom.el
+ @gsed -i "s/\"VERSION\"/\"$(ESSVERSION)\"/" lisp/ess-custom.el
@echo "*********************************************************"
.PHONY: lisp
@@ -59,7 +59,7 @@ autoloads:
essr: VERSION
@echo "**********************************************************"
@echo "** Making ESSRv$(ESSR-VERSION) **"
- @sed -i "s/^ *VERSION <- .*/ VERSION <- \"$(ESSR-VERSION)\"/" etc/ESSR/R/.load.R
+ @gsed -i "s/^ *VERSION <- .*/ VERSION <- \"$(ESSR-VERSION)\"/" etc/ESSR/R/.load.R
cd etc/ESSR/; ./BUILDESSR; cd -
@git add etc/ESSR.rds lisp/ess.el etc/ESSR/R/.load.R
git commit -m"ESSR Version $(ESSR-VERSION)"
@@ -160,7 +160,7 @@ cleanup-rel:
@rm -f tarballs dist tag homepage upload rel
%.spec: %.spec.in VERSION
- sed 's/@@VERSION@@/$(ESSVERSION)/g' $< > $@
+ gsed 's/@@VERSION@@/$(ESSVERSION)/g' $< > $@
## --- RELEASE section ---
--
2.42.0
#+end_src
** [[https://www.seas.upenn.edu/~chaoliu/2017/09/01/python-programming-in-emacs/][Python programming]]
:PROPERTIES:
:CUSTOM_ID: sec:python-programming