emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: david wen riccardi-zhu <dwrz@dwrz.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: 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	[thread overview]
Message-ID: <87vajrgfwe.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87vajrjetr.fsf@dwrz.net> (david wen riccardi-zhu's message of "Sat, 07 Oct 2017 12:57:20 +0000")

Hello,

david wen riccardi-zhu <dwrz@dwrz.net> 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	other threads:[~2017-10-07 15:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-07 12:57 Can I use a custom mode for org-src-lang-modes and still get syntax highlighting? david wen riccardi-zhu
2017-10-07 15:02 ` Nicolas Goaziou [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vajrgfwe.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=dwrz@dwrz.net \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).