aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcolin <colin@cicadas.surf>2023-08-28 07:06:48 -0700
committercolin <colin@cicadas.surf>2023-08-28 07:06:48 -0700
commit002d2084d6abe605ace03497848ceed803fb77ec (patch)
treedcc998303ca0e494a8367e1820891352df556873
parent4bbb24256eff216f4118200c630023a4c54560e6 (diff)
more python hacks
-rw-r--r--init-el.org67
1 files changed, 43 insertions, 24 deletions
diff --git a/init-el.org b/init-el.org
index 3b54a34..364b8aa 100644
--- a/init-el.org
+++ b/init-el.org
@@ -45,6 +45,7 @@
<<reading-notes-and-writing-config>>
<<software-development-config>>
<<tools-config>>
+
#+end_src
** Native Compilation
@@ -259,7 +260,6 @@ New in emacs 28, native compilation can be enabled:
#+name: org-mode-config
#+begin_src elisp :noweb no-export
<<org-mode-main-config>>
-<<org-mode-babel-config>>
<<org-mode-leader-key-menu>>
<<org-protocol-config>>
#+end_src
@@ -338,26 +338,6 @@ New in emacs 28, native compilation can be enabled:
#+RESULTS: org-mode-main-config
-** Org Mode and Babel Configuration
-
-
-#+name: org-mode-babel-config
-#+begin_src elisp :results none
-
-
-(org-babel-do-load-languages
- 'org-babel-load-languages
- '((emacs-lisp . t)
- (python . t)
- (lisp . t)
- (C . t)
- (shell . t)))
-
-(setf org-src-window-setup 'current-window)
-
-#+end_src
-
-
** My-Leader Key for Org Major Mode
#+name: org-mode-leader-key-menu
#+begin_src elisp :results none :noweb no-export
@@ -1150,6 +1130,7 @@ stand up and move around.
(setq elfeed-feeds
'(("https://harpers.org/feed" culture politics news)
("https://solar.lowtechmagazine.com/posts/index.xml" technology)
+ ("https://warandpeas.com/feed" comics)
("http://planet.lisp.org/rss20.xml" lisp blog)
("http://feeds.feedburner.com/FutilityCloset" art culture)
("http://feeds2.feedburner.com/NoTechMagazine" technology)
@@ -1294,15 +1275,48 @@ stand up and move around.
Hacks and tweaks for literate programming. Org auto tangle will tangle
a file whenever it is saved.
+This is also where I have placed the various configs for evaluating
+code in emacs org blocks.
+
#+name: literate-programming
-#+begin_src elisp :noweb no-export :results none
+#+begin_src elisp :noweb no-export
(package-install 'org-auto-tangle)
(require 'org-auto-tangle)
(add-hook 'org-mode-hook 'org-auto-tangle-mode)
+(package-install 'jupyter)
+
+(load "~/notes/elisp/ox-ipynb.el")
+
+(require 'ox-ipynb)
+
+(org-babel-do-load-languages
+ 'org-babel-load-languages
+ '((emacs-lisp . t)
+ (python . t)
+ (lisp . t)
+ (C . t)
+ (shell . t)
+ (jupyter . t)))
+
+(setf org-src-window-setup 'current-window)
+
+
+;; this is a hack to get syntax highlighting. The problem is that
+;; newer orgs don't know what to do with `#+begin_src jupyter-python`,
+;; so I just have to do `#+begin_src jupyter`, but then there's no
+;; syntax highlighting
+(define-derived-mode jupyter-mode python-mode "Python"
+ "Haxe syntax highlighting mode. This is simply using js-mode for now.")
+
+
#+end_src
+
+#+RESULTS: literate-programming
+: current-window
+
** Pair-Programming
#+name: pair-programming
@@ -1642,7 +1656,7 @@ from debian contrib
** Python
#+name: python-config
-#+begin_src elisp :noweb no-export
+#+begin_src elisp :noweb no-export :results none
(package-install 'pyvenv)
(setenv "WORKON_HOME" "~/miniconda3/envs")
@@ -1655,12 +1669,17 @@ from debian contrib
(setq python-shell-interpreter "jupyter"
python-shell-interpreter-args "console --simple-prompt"
python-shell-prompt-detect-failure-warning nil)
+
+
(add-to-list 'python-shell-completion-native-disabled-interpreters
"jupyter")
+
+
#+end_src
+#+RESULTS: python-config :results none
+
#+RESULTS: python-config
-| jupyter | pypy |
* Tools
#+name: tools-config