From 642c97bc647e22c148054b7457757bb33d295539 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sun, 31 Jan 2016 19:44:10 -0500 Subject: [PATCH] Add mmm-mode latex-python config --- .emacs.d/init.el | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 43cbb7b..1209ef7 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -280,6 +280,23 @@ pkgbuild-user-mail-address "contact@adamgoldsmith.name" pkgbuild-makepkg-command "PKGEXT='.pkg.tar' makepkg -mf")) +(use-package mmm-mode + :config + (mmm-add-classes + '((latex-python + :submode python-mode +; :creation-hook (lambda () (local-set-key (kbd "C-z") 'latex-save-and-compile)) + :face mmm-code-submode-face + :front "\\\\begin{python}\n" + :back "\\\\end{python}$"))) + (mmm-add-mode-ext-class 'latex-mode nil 'latex-python) + (defun python-shell-send-overlay () + (interactive) + (python-shell-send-region (previous-overlay-change (point)) (next-overlay-change (point)))) + (add-hook 'mmm-python-submode-hook + (lambda () + (local-set-key (kbd "C-c C-c") 'python-shell-send-overlay)))) + ;;; Local Variables (add-to-list 'safe-local-eval-forms '(outline-hide-body)) ;; Local Variables: