Remove Julia support

This commit is contained in:
Gerard Vermeulen 2024-06-11 19:56:24 +02:00
parent 826f136d54
commit eba271ef75

View File

@ -2209,7 +2209,6 @@ list detailing and motivating each listing:
(eshell . t)
(fortran . t)
(gnuplot . ,(fboundp 'gnuplot-mode))
(julia . t)
(latex . t)
(lilypond . ,(fboundp 'lilypond-mode))
(lisp . t)
@ -2312,7 +2311,6 @@ When called twice, replace the previously inserted \\(\\) by one $."
(defcustom org-insert-source-block-defaults
'("calc -n :results silent"
"emacs-lisp -n :results silent"
"julia -n :results silent"
"latex -n"
"lisp -n :results silent :package :cs325-user"
"org -n"
@ -2754,9 +2752,9 @@ SCHEDULED: <2023-06-30 Fri>
#+caption: Active Org Babel languages.
#+RESULTS: lst:org-babel-active-languages
#+begin_src emacs-lisp -n :eval never :tangle no
(("calc") ("conf") ("emacs-lisp") ("eshell") ("fortran") ("julia")
("latex") ("latex-extra-header") ("latex-header") ("lisp") ("org")
("perl") ("python") ("ruby") ("shell") ("text") ("toml"))
(("calc") ("emacs-lisp") ("eshell") ("fortran") ("latex")
("latex-extra-header") ("latex-header") ("lisp") ("org") ("perl")
("python") ("ruby") ("shell"))
#+end_src
#+caption[Get "in-buffer" settings]:
@ -4142,16 +4140,13 @@ out of your way. [[info:eglot#Top][Eglot (info)]] is a builtin since Emacs-29.1
listings contribute to a programming language mode independent [[https://github.com/joaotavora/eglot][Eglot]]
configuration:
1. Listing [[lst:minimal-eglot-setup][minimal Eglot setup]] adds key bindings to =eglot-mode-keymap=.
2. Listing [[lst:setup-eglot-jl]] adds [[https://julialang.org/][Julia]] support to [[info:eglot#Top][Eglot (info)]].
3. Listing [[lst:cli-eglot-jl-setup]] shows how to setup [[https://github.com/non-Jedi/eglot-jl][eglot-jl]] from the command
line.
4. Listing [[lst:setup-oglot]] uses [[https://github.com/gav451/oglot#][oglot]] to enable using [[https://github.com/joaotavora/eglot][Eglot]] in =org-src-mode=
Julia and Python buffers.
5. Listing [[lst:eglot-maybe-ensure]] starts [[https://github.com/joaotavora/eglot][Eglot]] in case of proper programming
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 (and not for Julia 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
programming modes).
6. Listing [[lst:whiten-black]] defines Emacs Lisp functions to undo (whiten) some
4. Listing [[lst:whiten-black]] defines Emacs Lisp functions to undo (whiten) some
output of [[https://black.readthedocs.io/en/stable/][Black]] after src_emacs-lisp[:results silent]{(org-babel-tangle)}.
#+caption[Ensure =eglot= installation with minimal setup]:
@ -4164,31 +4159,12 @@ configuration:
(keymap-set eglot-mode-map "C-c r" 'eglot-rename))
#+end_src
#+caption: Setup ~eglot~ for ~julia-mode~.
#+name: lst:setup-eglot-jl
#+begin_src emacs-lisp -n :results silent
;; How to invoke `imenu-add-menubar-index' automatically?
;; Neither advising `eglot' nor hooking major modes seems to work.
(when (ensure-package-installation 'eglot-jl)
(eglot-jl-init))
#+end_src
#+caption[Setup =eglot-jl= from the command line]:
#+caption: Setup =eglot-jl= from the command line.
#+name: lst:cli-eglot-jl-setup
#+begin_src shell :eval never
# Run this from `package-user-dir':
julia --project=eglot-jl-20240318.1159/ eglot-jl-20240318.1159/eglot-jl.jl
# The SymbolServer is ready caching dependencies when it displays:
# [ Info: Received new data from Julia Symbol Server.
#+end_src
#+caption: Setup ~oglot~ for ~julia-mode~ and ~python-mode~.
#+caption: Setup ~oglot~ for ~python-mode~.
#+name: lst:setup-oglot
#+begin_src emacs-lisp -n :results silent
(when (and (package-installed-p 'oglot)
(require 'oglot nil 'noerror))
(setopt oglot-maybe-ensure-modes '(julia-mode python-mode)))
(setopt oglot-maybe-ensure-modes '(python-mode)))
#+end_src
#+caption[Start =eglot= in case of a proper =dir-local-variables-alist=]:
@ -5082,164 +5058,6 @@ Links for further investigation are:
(add-to-list 'auto-mode-alist `(,(rx ".go" eos) . go-ts-mode)))
#+end_src
** [[https://julialang.org/][Julia programming]]
:PROPERTIES:
:CUSTOM_ID: sec:julia-programming
:END:
Points for further investigation are:
1. Application of the [[https://docs.julialang.org/en/v1/stdlib/Pkg/][Julia Pkg documentation]] requires {{{kbd(M-x term)}}} or a
terminal because the inferior Julia interpreter provides no genuine terminal.
Type {{{kbd(])}}} to enter package mode and type {{{kbd(<backspace>)}}} or
click ~BREAK~ on the ~SIGNALS~ menu to leave package mode. Type
{{{kbd(st)}}} in package mode to see a list of added packages. Julia does
not recognize dependencies anymore. Therefore, I have used package mode to
add ~StaticLint~ and ~SymbolServer~ to make a patched version of [[https://github.com/non-Jedi/eglot-jl][eglot-jl]]
work.
2. [[https://github.com/emacs-ess/ESS/wiki/Julia][ESS support for the Julia language]] is a somewhat outdated description of how
to obtain [[https://julialang.org/][Julia]] support for [[https://ess.r-project.org/][Emacs Speaks Statistics]] and [[https://www.gnu.org/software/emacs/][Emacs]].
3. [[https://www.packtpub.com/product/hands-on-design-patterns-and-best-practices-with-julia/9781838648817][Hands-On: Design Patterns and Best Practices with Julia]] is a Julia book with
good reviews.
4. [[https://juliabyexample.helpmanual.io/][Julia by example]] is a showcase of 1- or 2-liners.
5. [[https://github.com/JuliaCI/PkgTemplates.jl][PkgTemplates]] and [[https://juliaci.github.io/PkgTemplates.jl/stable/user/][PkgTemplates User Guide]] explain how to write a [[https://julialang.org/][Julia]]
package. [[https://julialang.org/contribute/developing_package/][How to develop a Julia package]] is friendlier but not up to date.
6. [[https://nostarch.com/practical-julia][Practical Julia]] is Julia book with good reviews.
7. The list of installed packages in listing [[lst:list-julia-packages-result]]
facilitate [[https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-julia.html][Julia Code Blocks in Babel]] because the list contains [[https://github.com/JuliaData/CSV.jl][CSV]] and
[[https://dataframes.juliadata.org/stable/][DataFrames]].
8. How to update automatically to the [[https://julialang.org/downloads/#current_stable_release][current stable release of Julia]].
A list of interesting online course material is:
1. [[https://ucidatascienceinitiative.github.io/IntroToJulia/][A Deep Introduction to Julia for Data Science and Scientific Computing]].
2. [[https://juliateachingctu.github.io/Julia-for-Optimization-and-Learning/stable/][Julia for Optimization and Learning]].
3. [[https://github.com/JuliaTeachingCTU/Julia-for-Optimization-and-Learning-Scripts][Julia for Optimization and Learning Scripts]].
4. [[https://julia.quantecon.org/intro.html][Quantitative Economics with Julia]] (use backspace to leave package mode).
Here are links to Julia programming background videos:
1. [[yt:3Ix53dRmcqU][Creating a Julia Pkg with PkgTemplates.jl]]
2. [[yt:pOeTz8UlWoc][Revise.jl, Docstrings, Tests, and structuring a Julia package]]
Listing [[lst:setup-julia]] setups [[https://julialang.org/][Julia]] support but requires manual tweaking of
[[../VCS/ESS/Makefile][Makefile]] to replace [[https://en.wikipedia.org/wiki/Sed][sed]] with [[https://formulae.brew.sh/formula/gnu-sed][gsed]] and of [[../VCS/ESS/lisp/ess-autoloads.el][ess-autoloads.el]].
#+caption[Setup Julia programming]:
#+caption: Setup Julia programming.
#+name: lst:setup-julia
#+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")))
#+end_src
#+caption[List installed Julia packages]:
#+caption: List installed Julia packages.
#+name: lst:list-julia-packages
#+header: :wrap "src toml -n"
#+begin_src shell :exports both :results raw
cat "$HOME/.julia/environments/v1.10/Project.toml"
#+end_src
#+caption[List installed Julia packages result]:
#+caption: List installed Julia packages result.
#+name: lst:list-julia-packages-result
#+RESULTS: lst:list-julia-packages
#+begin_src toml -n
[deps]
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Calculus = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a"
LanguageServer = "2b0e0bc5-e4fd-59b4-8912-456d1b03d8d7"
Luxor = "ae8d54c2-7ccd-5906-9d76-62fc9837b5bc"
Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
PkgTemplates = "14b8a8f1-9102-5b29-a752-f990bacb7fe1"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
StaticLint = "b3cc710f-9c33-5bdb-a03d-a94903873e97"
SymbolServer = "cf896787-08d5-524d-9de7-132aaa0cb996"
#+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
@ -6052,7 +5870,7 @@ formatter for Python]].
#+begin_src emacs-lisp -n :results silent
(when (and (ensure-package-installation 'electric-operator)
(fboundp 'electric-operator-mode))
(dolist (symbol '(c-mode-common-hook julia-mode-hook python-mode-hook))
(dolist (symbol '(c-mode-common-hook python-mode-hook))
(add-hook symbol #'electric-operator-mode)))
#+end_src