Skip to content

Instantly share code, notes, and snippets.

@smaret
Created August 15, 2014 14:40
Show Gist options
  • Save smaret/062a882305b5b95f5309 to your computer and use it in GitHub Desktop.
Save smaret/062a882305b5b95f5309 to your computer and use it in GitHub Desktop.
Polymode with Python Emacs crash
(require 'polymode)
(defcustom pm-host/test
(pm-bchunkmode "test"
:mode 'fundamental-mode)
"Test host chunkmode"
:group 'hostmodes
:type 'object)
(defcustom pm-inner/pytest
(pm-hbtchunkmode "python"
:head-reg "^begin .*\.py"
:tail-reg "^end .*\.py"
:mode 'python-mode)
"Python chunk."
:group 'innermodes
:type 'object)
(defcustom pm-poly/test
(pm-polymode-one "pytest"
:hostmode 'pm-host/test
:innermode 'pm-inner/pytest)
"Polymode for Test."
:group 'polymodes
:type 'object)
(define-polymode poly-test-mode pm-poly/test)
(provide 'test-mode)
This is some text
begin data test.py
def hello():
print "hello"
end data test.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment