commit 4bdfeb00c0694cfdadb156f427a0545a31d3a3ad
parent ba008c260c0119157946715a57ce1157ed7daf39
Author: Ethan Long <ethandavidlong@gmail.com>
Date: Sat, 23 Dec 2023 00:13:20 +1100
Not using OCaml or Clojure, they are to be gone
Removed them from the config to lower dependencies and simplify the
config.
Diffstat:
| M | config.org | | | 26 | +++----------------------- |
| D | opam-user-setup.el | | | 131 | ------------------------------------------------------------------------------- |
2 files changed, 3 insertions(+), 154 deletions(-)
diff --git a/config.org b/config.org
@@ -508,12 +508,11 @@ This basic LSP setup is based on the golang guide: https://cs.opensource.google/
#+end_src
** Java
OO hell 😌
-Using the Eclipse JDT Language Server:
+If you want a language server, maybe just use IntelliJ? I don't use Java and the ~eglot-java~ package has broken for my config, complaining about the eglot version.
#+begin_src emacs-lisp
;; Java setup
- (use-package eglot-java
- :after eglot
- :hook ((java-mode java-ts-mode) . eglot-java-mode)
+ (use-package emacs
+ :elpaca nil
:config
(when treesit-enabled
(push '(java-mode . java-ts-mode) major-mode-remap-alist)))
@@ -550,25 +549,6 @@ A.K.A. the most overused and overhyped language. This language is incredibly slo
(when treesit-enabled
(push '(python-mode . python-ts-mode) major-mode-remap-alist)))
#+end_src
-** OCaml
-This is the basic OCaml config provided by opam on installation. It may be actually better to just use the language server that OCaml installed...
-#+begin_src emacs-lisp
- (defun set-ocaml-error-regexp ()
- (set
- 'compilation-error-regexp-alist
- (list '("[Ff]ile \\(\"\\(.*?\\)\", line \\(-?[0-9]+\\)\\(, characters \\(-?[0-9]+\\)-\\([0-9]+\\)\\)?\\)\\(:\n\\(\\(Warning .*?\\)\\|\\(Error\\)\\):\\)?"
- 2 3 (5 . 6) (9 . 11) 1 (8 compilation-message-face)))))
-
- (add-hook 'tuareg-mode-hook 'set-ocaml-error-regexp)
- (add-hook 'caml-mode-hook 'set-ocaml-error-regexp)
- ;; ## added by OPAM user-setup for emacs / base ## 56ab50dc8996d2bb95e7856a6eddb17b ## you can edit, but keep this line
- (require 'opam-user-setup (expand-file-name "opam-user-setup.el" user-emacs-directory))
-#+end_src
-** Clojure
-Installing clojure mode.
-#+begin_src emacs-lisp
- (use-package clojure-mode)
-#+end_src
** LaTeX
LaTeX isn't really a language, but we should set up stuff for it.
Firstly, we should get CDLaTeX:
diff --git a/opam-user-setup.el b/opam-user-setup.el
@@ -1,131 +0,0 @@
-;; ## added by OPAM user-setup for emacs / base ## cfd3c9b7837c85cffd0c59de521990f0 ## you can edit, but keep this line
-(provide 'opam-user-setup)
-
-;; Base configuration for OPAM
-
-(defun opam-shell-command-to-string (command)
- "Similar to shell-command-to-string, but returns nil unless the process
- returned 0, and ignores stderr (shell-command-to-string ignores return value)"
- (let* ((return-value 0)
- (return-string
- (with-output-to-string
- (setq return-value
- (with-current-buffer standard-output
- (process-file shell-file-name nil '(t nil) nil
- shell-command-switch command))))))
- (if (= return-value 0) return-string nil)))
-
-(defun opam-update-env (switch)
- "Update the environment to follow current OPAM switch configuration"
- (interactive
- (list
- (let ((default
- (car (split-string (opam-shell-command-to-string "opam switch show --safe")))))
- (completing-read
- (concat "opam switch (" default "): ")
- (split-string (opam-shell-command-to-string "opam switch list -s --safe") "\n")
- nil t nil nil default))))
- (let* ((switch-arg (if (= 0 (length switch)) "" (concat "--switch " switch)))
- (command (concat "opam config env --safe --sexp " switch-arg))
- (env (opam-shell-command-to-string command)))
- (when (and env (not (string= env "")))
- (dolist (var (car (read-from-string env)))
- (setenv (car var) (cadr var))
- (when (string= (car var) "PATH")
- (setq exec-path (split-string (cadr var) path-separator)))))))
-
-(opam-update-env nil)
-
-(defvar opam-share
- (let ((reply (opam-shell-command-to-string "opam config var share --safe")))
- (when reply (substring reply 0 -1))))
-
-(add-to-list 'load-path (concat opam-share "/emacs/site-lisp"))
-;; OPAM-installed tools automated detection and initialisation
-
-(defun opam-setup-tuareg ()
- (add-to-list 'load-path (concat opam-share "/tuareg") t)
- (load "tuareg-site-file"))
-
-(defun opam-setup-add-ocaml-hook (h)
- (add-hook 'tuareg-mode-hook h t)
- (add-hook 'caml-mode-hook h t))
-
-(defun opam-setup-complete ()
- (if (require 'company nil t)
- (opam-setup-add-ocaml-hook
- (lambda ()
- (company-mode)
- (defalias 'auto-complete 'company-complete)))
- (require 'auto-complete nil t)))
-
-(defun opam-setup-ocp-indent ()
- (opam-setup-complete)
- (autoload 'ocp-setup-indent "ocp-indent" "Improved indentation for Tuareg mode")
- (autoload 'ocp-indent-caml-mode-setup "ocp-indent" "Improved indentation for Caml mode")
- (add-hook 'tuareg-mode-hook 'ocp-setup-indent t)
- (add-hook 'caml-mode-hook 'ocp-indent-caml-mode-setup t))
-
-(defun opam-setup-ocp-index ()
- (autoload 'ocp-index-mode "ocp-index" "OCaml code browsing, documentation and completion based on build artefacts")
- (opam-setup-add-ocaml-hook 'ocp-index-mode))
-
-(defun opam-setup-merlin ()
- (opam-setup-complete)
- (require 'merlin)
- (opam-setup-add-ocaml-hook 'merlin-mode)
-
- (defcustom ocp-index-use-auto-complete nil
- "Use auto-complete with ocp-index (disabled by default by opam-user-setup because merlin is in use)"
- :group 'ocp_index)
- (defcustom merlin-ac-setup 'easy
- "Use auto-complete with merlin (enabled by default by opam-user-setup)"
- :group 'merlin-ac)
-
- ;; So you can do it on a mac, where `C-<up>` and `C-<down>` are used
- ;; by spaces.
- (define-key merlin-mode-map
- (kbd "C-c <up>") 'merlin-type-enclosing-go-up)
- (define-key merlin-mode-map
- (kbd "C-c <down>") 'merlin-type-enclosing-go-down)
- (set-face-background 'merlin-type-face "skyblue"))
-
-(defun opam-setup-utop ()
- (autoload 'utop "utop" "Toplevel for OCaml" t)
- (autoload 'utop-minor-mode "utop" "Minor mode for utop" t)
- (add-hook 'tuareg-mode-hook 'utop-minor-mode))
-
-(defvar opam-tools
- '(("tuareg" . opam-setup-tuareg)
- ("ocp-indent" . opam-setup-ocp-indent)
- ("ocp-index" . opam-setup-ocp-index)
- ("merlin" . opam-setup-merlin)
- ("utop" . opam-setup-utop)))
-
-(defun opam-detect-installed-tools ()
- (let*
- ((command "opam list --installed --short --safe --color=never")
- (names (mapcar 'car opam-tools))
- (command-string (mapconcat 'identity (cons command names) " "))
- (reply (opam-shell-command-to-string command-string)))
- (when reply (split-string reply))))
-
-(defvar opam-tools-installed (opam-detect-installed-tools))
-
-(defun opam-auto-tools-setup ()
- (interactive)
- (dolist (tool opam-tools)
- (when (member (car tool) opam-tools-installed)
- (funcall (symbol-function (cdr tool))))))
-
-(opam-auto-tools-setup)
-;; ## end of OPAM user-setup addition for emacs / base ## keep this line
-;; ## added by OPAM user-setup for emacs / ocp-indent ## dbe5bfcf29ff0e6137a583f7be1bef1d ## you can edit, but keep this line
-;; Load ocp-indent from its original switch when not found in current switch
-(when (not (assoc "ocp-indent" opam-tools-installed))
- (autoload 'ocp-setup-indent "/Users/ethan/.opam/5.0.0/share/emacs/site-lisp/ocp-indent.el" "Improved indentation for Tuareg mode")
- (autoload 'ocp-indent-caml-mode-setup "/Users/ethan/.opam/5.0.0/share/emacs/site-lisp/ocp-indent.el" "Improved indentation for Caml mode")
- (add-hook 'tuareg-mode-hook 'ocp-setup-indent t)
- (add-hook 'caml-mode-hook 'ocp-indent-caml-mode-setup t)
- (setq ocp-indent-path "/Users/ethan/.opam/5.0.0/bin/ocp-indent"))
-;; ## end of OPAM user-setup addition for emacs / ocp-indent ## keep this line