From 002d2084d6abe605ace03497848ceed803fb77ec Mon Sep 17 00:00:00 2001 From: colin Date: Mon, 28 Aug 2023 07:06:48 -0700 Subject: more python hacks --- init-el.org | 67 +++++++++++++++++++++++++++++++++++++++---------------------- 1 file 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 @@ <> <> <> + #+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 <> -<> <> <> #+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 -- cgit v1.2.3