emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Can I use a custom mode for org-src-lang-modes and still get syn


From: Nicolas Goaziou
Subject: Re: [O] Can I use a custom mode for org-src-lang-modes and still get syntax highlighting?
Date: Sat, 07 Oct 2017 17:02:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Hello,

david wen riccardi-zhu <address@hidden> writes:

> I'm trying to get syntax highlighting with org-mode source blocks
> using a custom language mode for editing JavaScript. I use js2-mode
> with a bunch of minor modes, rather than js-mode, which is what
> org-mode uses by default.
>
> I was able to get org-mode to use js2-mode for editing code by
> customizing org-src-lang-modes, where I set the Cons-cell for
> javacript to js2.
>
> However, syntax highlighting has stopped working in the org buffer (it
> works fine in the source buffer). This is with
> org-src-fontify-natively set to true, which the documentation suggests
> is the only requirement.
>
> Is there anything I'm missing?

`org-src-font-lock-fontify-block' uses the same mechanism as
`org-edit-src-code' to determine what major mode to load. IOW, it should
work out of the box.

Could you provide an ECM?

Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]