SICMUtils, 2
.
The goal of this post to setup the Emacs editor for Clojure programming.
.
1. Read and follow the exact steps of the last post.
.
2. Open the .emacs file. Go to the end of the file. Add the following code:
(require 'org)
(require 'ob-clojure)
(setq org-babel-clojure-backend 'cider)
(require 'cider)
(set-register ?c '(file . "~/my-stuff/my-stuff.org"))
(setq org-confirm-babel-evaluate nil)
(setq org-src-tab-acts-natively t)
3. Close Emacs.
.
4. Go to the directory “~/my-stuff/” and then create a file named “my-stuff.org“.
5. Use Emacs to open the file.
6. Within the file, add the following code:
#+BEGIN_SRC emacs-lisp
(+ 1 1)
#+END_SRC
7. Place the text cursor in the code block (between the line #+BEGIN_SRC and the line #+END_SRC).
8. Hit the Emacs command
C-c C-c
9. You will get the evaluation result:
#+RESULTS:
: 2
.
10. Hit the Emacs command:
M-x cider-jack-in
11. Within the file “my-stuff.org“, add the code:
#+BEGIN_SRC clojure :results value
(require '[sicmutils.env :as env])
#+END_SRC
12. Place the text cursor in the code block.
13. Hit the Emacs command
C-c C-c
.
14. Add the code:
#+BEGIN_SRC clojure :results value
(env/bootstrap-repl!)
#+END_SRC
15. Place the text cursor in the code block and then hit the Emacs command
C-c C-c
.
16. Add the code:
#+BEGIN_SRC clojure :results replace drawer
(->TeX (simplify ((D cube) 'x)))
#+END_SRC
17. Place the text cursor and then hit
C-c C-c
It will give you the
code
#+RESULTS:
:RESULTS:
"3\\,{x}^{2}"
:END:
— Me@2022-07-27 11:34:28 PM
.
.
2022.07.28 Thursday (c) All rights reserved by ACHK
You must be logged in to post a comment.