syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.64k stars 4.89k forks source link

pyvenv in Python layer causes mmm-noweb (literate programming) to not work #10292

Closed rhaps0dy closed 4 years ago

rhaps0dy commented 6 years ago

Description :octocat:

I'm trying to use noweb to do literate programming, using mmm-noweb from mmm-mode. The mode is supposed to do syntax highlighting of both LaTeX and some other programming language (in my case Python) in different parts of the program.

The syntax highlighting doesn't work correctly when the package pyvenv is enabled in the python layer. The syntax highlighting works correctly in other languages inside noweb, like Lua.

Reproduction guide :beetle:

(defconst noweb-packages '(mmm-mode))

(defun noweb/post-init-mmm-mode ()
  (require 'mmm-noweb)
  (setq mmm-global-mode 'maybe)
  (setq mmm-mode-ext-classes-alist '((nil "\\.nw$" noweb)))
  (add-to-list 'auto-mode-alist '("\\.nw$" . latex-mode)))

If the markdown layer (which owns mmm-mode) isn't enabled, post-init-mmm-mode isn't run for some reason. I'm not sure if this is expected behaviour.

Observed behaviour: :eyes: :broken_heart:

There is no syntax highlighting for the Python bit image1. In addition, when the point is in the Python bit, the mode stays as LaTeX/MPS image2, compare mode with image1.

Expected behaviour: :heart: :smile:

There is proper syntax highlighting for both Python and LaTeX image1. When the point is in a LaTeX region, the major mode is LaTeX/MPS. When it is in a Python region, the mode is LaTeX/MPS[Python] image2, compare mode with image1.

You can reproduce this behaviour by commenting out pyvenv in the python-packages list in ~/.emacs.d/layers/+lang/python/packages.el.

System Info :computer:

github-actions[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!