Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

markdown-edit-code-block will not activate treesit mode (e.g. python-ts-mode), but activate python-mode #787

Closed
milanglacier opened this issue Aug 5, 2023 · 1 comment

Comments

@milanglacier
Copy link

milanglacier commented Aug 5, 2023

Expected Behavior

C-c ' into a python code block will activate python-ts-mode

Actual Behavior

python-mode will be activated

Steps to Reproduce

this is the minimal example config file:

;;; minimal-init.el -*- lexical-binding: t; -*-

;; this is for debugging purpose

(require 'package)
(setq package-user-dir "~/Downloads/emacs-package-dir")

(setq package-list '(markdown-mode edit-indirect))
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(package-initialize)

(unless package-archive-contents
  (package-refresh-contents))

(dolist (package package-list)
  (unless (package-installed-p package)
    (package-install package)))

(setq warning-minimum-level :error)

(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
(xterm-mouse-mode 1)

(setq scroll-step 1)
(setq scroll-conservatively 10000)
(setq auto-window-vscroll nil)

(setq major-mode-remap-alist '((python-mode . python-ts-mode)))

(setq treesit-language-source-alist
          '((python . ("https://github.com/tree-sitter/tree-sitter-python"))))

the minimal markdown file (hello.md) is: https://pastebin.com/ymfgDng6

  1. Step A

M-x treesit-install-language-grammar python

  1. Step B

emacs -Q -l "minimal-init.el" hello.md

  1. Step C

Backtrace

go to the python code block, press C-c ', and C-h v to see the major mode, get python-mode rather than python-ts-mode

Software Versions

  • Markdown Mode: 2.6 alpha (commit 50ac14f)
  • Emacs: 29.1.5
  • OS: macos 13.4
@syohex
Copy link
Collaborator

syohex commented Aug 7, 2023

I have merged #788. Please check latest version.

@syohex syohex closed this as completed Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants